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

feat: eip-3074 #1104

Merged
merged 11 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions blockchain-tests-skip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ testname:
- sha3_d3g0v0_Cancun #RunResources error
stAttackTest:
- ContractCreationSpam_d0g0v0_Cancun #RunResources error
stBadOpcode:
- badOpcodes_d111g0v0_Cancun #EIP-3074
- badOpcodes_d112g0v0_Cancun #EIP-3074
stChainId:
- chainId_d0g0v0_Cancun
stCreate2:
Expand Down
19 changes: 11 additions & 8 deletions src/kakarot/constants.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ namespace Constants {
const MAX_CODE_SIZE = 0x6000;

const BURN_ADDRESS = 0xdead;

// AUTH MAGIC
const MAGIC = 0x04;
}

// See model.Opcode:
Expand Down Expand Up @@ -1503,18 +1506,18 @@ dw Gas.CREATE;
dw 4;
dw 4;
dw -3;
// INVALID
// AUTH
dw 0xf6;
dw 0;
dw 0;
dw 0;
dw 0;
// INVALID
dw 3;
dw 3;
dw -2;
// AUTHCALL
dw 0xf7;
dw 0;
dw 0;
dw 0;
dw 0;
dw 7;
dw 7;
dw -6;
// INVALID
dw 0xf8;
dw 0;
Expand Down
2 changes: 2 additions & 0 deletions src/kakarot/evm.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ namespace EVM {
code_address=evm.message.code_address,
read_only=evm.message.read_only,
is_create=evm.message.is_create,
authorized=evm.message.authorized,
depth=evm.message.depth,
env=evm.message.env,
);
Expand Down Expand Up @@ -244,6 +245,7 @@ namespace EVM {
code_address=self.message.code_address,
read_only=self.message.read_only,
is_create=self.message.is_create,
authorized=self.message.authorized,
depth=self.message.depth,
env=self.message.env,
);
Expand Down
2 changes: 2 additions & 0 deletions src/kakarot/gas.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ namespace Gas {
const ZERO = 0;
const NEW_ACCOUNT = 25000;
const CALL_VALUE = 9000;
const AUTHCALL_VALUE = 6700;
const CALL_STIPEND = 2300;
const SELF_DESTRUCT = 5000;
const SELF_DESTRUCT_NEW_ACCOUNT = 25000;
Expand All @@ -53,6 +54,7 @@ namespace Gas {
const TX_ACCESS_LIST_ADDRESS_COST = 2400;
const TX_ACCESS_LIST_STORAGE_KEY_COST = 1900;
const BLOBHASH = 3;
const AUTH = 3100;

// @notice Compute the cost of the memory for a given words length.
// @dev To avoid range_check overflow, we compute words_len / 512
Expand Down
Loading
Loading