warm delegatee account if transaction destination has delegated code

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
pectra-devnet3-block-110500-issue
Daniel Lehrner 1 month ago
parent dcefdce450
commit 63933997fd
  1. 7
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionProcessor.java

@ -415,7 +415,6 @@ public class MainnetTransactionProcessor {
.miningBeneficiary(miningBeneficiary) .miningBeneficiary(miningBeneficiary)
.blockHashLookup(blockHashLookup) .blockHashLookup(blockHashLookup)
.contextVariables(contextVariablesBuilder.build()) .contextVariables(contextVariablesBuilder.build())
.accessListWarmAddresses(warmAddressList)
.accessListWarmStorage(storageList); .accessListWarmStorage(storageList);
if (transaction.getVersionedHashes().isPresent()) { if (transaction.getVersionedHashes().isPresent()) {
@ -439,12 +438,17 @@ public class MainnetTransactionProcessor {
.contract(contractAddress) .contract(contractAddress)
.inputData(initCodeBytes.slice(code.getSize())) .inputData(initCodeBytes.slice(code.getSize()))
.code(code) .code(code)
.accessListWarmAddresses(warmAddressList)
.build(); .build();
} else { } else {
@SuppressWarnings("OptionalGetWithoutIsPresent") // isContractCall tests isPresent @SuppressWarnings("OptionalGetWithoutIsPresent") // isContractCall tests isPresent
final Address to = transaction.getTo().get(); final Address to = transaction.getTo().get();
final Optional<Account> maybeContract = Optional.ofNullable(evmWorldUpdater.get(to)); final Optional<Account> maybeContract = Optional.ofNullable(evmWorldUpdater.get(to));
if (maybeContract.isPresent() && maybeContract.get().hasDelegatedCode()) {
warmAddressList.add(maybeContract.get().delegatedCodeAddress().get());
}
initialFrame = initialFrame =
commonMessageFrameBuilder commonMessageFrameBuilder
.type(MessageFrame.Type.MESSAGE_CALL) .type(MessageFrame.Type.MESSAGE_CALL)
@ -455,6 +459,7 @@ public class MainnetTransactionProcessor {
maybeContract maybeContract
.map(c -> messageCallProcessor.getCodeFromEVM(c.getCodeHash(), c.getCode())) .map(c -> messageCallProcessor.getCodeFromEVM(c.getCodeHash(), c.getCode()))
.orElse(CodeV0.EMPTY_CODE)) .orElse(CodeV0.EMPTY_CODE))
.accessListWarmAddresses(warmAddressList)
.build(); .build();
} }
Deque<MessageFrame> messageFrameStack = initialFrame.getMessageFrameStack(); Deque<MessageFrame> messageFrameStack = initialFrame.getMessageFrameStack();

Loading…
Cancel
Save