Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
feat: chain_id mod 53
Browse files Browse the repository at this point in the history
  • Loading branch information
obatirou committed Aug 26, 2024
1 parent a6cb462 commit 783aae6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/kakarot/library.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ namespace Kakarot {
chain_id: felt
) {
let (tx_info) = get_tx_info();
let (_, chain_id) = unsigned_div_rem(tx_info.chain_id, 2 ** 32);
let (_, chain_id) = unsigned_div_rem(tx_info.chain_id, 2 ** 53);
return (chain_id=chain_id);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/src/kakarot/instructions/test_block_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ def test__exec_block_information(self, cairo_run, opcode, expected_result):
}
),
)
def test__exec_chain_id__should_return_mod_64(self, cairo_run):
def test__exec_chain_id__should_return_mod_53(self, cairo_run):
output = cairo_run("test__exec_block_information", opcode=Opcodes.CHAINID)
assert output == hex(BIG_CHAIN_ID % 2**32)
assert output == hex(BIG_CHAIN_ID % 2**53)

0 comments on commit 783aae6

Please sign in to comment.