Skip to content

Commit dc04b66

Browse files
lupin012web-flow
andauthored
rpcdaemon: add filter on precompile (#2802)
* add filter on precompile * fix on account_exist * make fmt * remove check --------- Co-authored-by: GitHub <[email protected]>
1 parent ca995b4 commit dc04b66

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

silkworm/core/execution/evm.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -218,18 +218,20 @@ evmc::Result EVM::call(const evmc_message& message) noexcept {
218218

219219
const auto snapshot{state_.take_snapshot()};
220220

221+
const evmc_revision rev{revision()};
222+
221223
if (message.kind == EVMC_CALL) {
222224
if (message.flags & EVMC_STATIC) {
223225
// Match geth logic
224226
// https://github.com/ethereum/go-ethereum/blob/v1.9.25/core/vm/evm.go#L391
225-
state_.touch(message.recipient);
227+
if (!precompile::is_precompile(message.recipient, rev)) {
228+
state_.touch(message.recipient);
229+
}
226230
} else {
227231
transfer(state_, message.sender, message.recipient, value, bailout);
228232
}
229233
}
230234

231-
const evmc_revision rev{revision()};
232-
233235
if (precompile::is_precompile(message.code_address, rev)) {
234236
static_assert(std::size(precompile::kContracts) < 256);
235237
const uint8_t num{message.code_address.bytes[kAddressLength - 1]};

0 commit comments

Comments
 (0)