Skip to content

Commit

Permalink
Update according to ethereum/EIPs/pull/6040
Browse files Browse the repository at this point in the history
  • Loading branch information
yperbasis committed Nov 30, 2022
1 parent 1feeeb4 commit ef0c4ba
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 32 deletions.
25 changes: 2 additions & 23 deletions cmd/test/consensus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,29 +197,8 @@ static const std::map<std::string, ChainConfig> kNetworkConfig{
.gray_glacier_block = 0,
.terminal_total_difficulty = 0,
}},
{"Merge+3860", // Shanghai actually
{
.chain_id = 1,
.seal_engine = SealEngineType::kNoProof,
.evmc_fork_blocks =
{
0, // Homestead
0, // Tangerine Whistle
0, // Spurious Dragon
0, // Byzantium
0, // Constantinople
0, // Petersburg
0, // Istanbul
0, // Berlin
0, // London
0, // Merge Netsplit (FORK_NEXT_VALUE)
0, // Shanghai
},
.muir_glacier_block = 0,
.arrow_glacier_block = 0,
.gray_glacier_block = 0,
.terminal_total_difficulty = 0,
}},
{"Merge+3855", test::kShanghaiConfig},
{"Merge+3860", test::kShanghaiConfig},
{"ArrowGlacierToMergeAtDiffC0000",
{
.chain_id = 1,
Expand Down
8 changes: 1 addition & 7 deletions core/silkworm/execution/evm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,11 @@ evmc::Result EVM::create(const evmc_message& message) noexcept {
return res;
}

const evmc_revision rev{revision()};
// EIP-3860: Limit and meter initcode
if (rev >= EVMC_SHANGHAI && message.input_size > param::kMaxInitCodeSize) {
res.status_code = EVMC_ARGUMENT_OUT_OF_RANGE;
return res;
}

auto snapshot{state_.take_snapshot()};

state_.create_contract(contract_addr);

const evmc_revision rev{revision()};
if (rev >= EVMC_SPURIOUS_DRAGON) {
state_.set_nonce(contract_addr, 1);
}
Expand Down
2 changes: 1 addition & 1 deletion third_party/evmone

0 comments on commit ef0c4ba

Please sign in to comment.