Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for initialization and finalization sections #1657

Merged
Merged
Show file tree
Hide file tree
Changes from 85 commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
aeba8cb
update constraints
lorenzogentile404 Dec 12, 2024
6d92234
update hub trace file and fix corresponding tracing
lorenzogentile404 Dec 12, 2024
c2519b1
update initialization section
lorenzogentile404 Dec 14, 2024
f3c97fa
manage reverted transaction case for initialization section
lorenzogentile404 Dec 14, 2024
ef90cfc
update finalization section
lorenzogentile404 Dec 14, 2024
0650b11
improve naming and structure
lorenzogentile404 Dec 15, 2024
84136fb
add resolvePostTransaction
lorenzogentile404 Dec 15, 2024
318e98f
minor changes
lorenzogentile404 Dec 16, 2024
f5eb806
Merge branch 'arith-dev' into 1648-initialization-and-finalization-se…
lorenzogentile404 Dec 16, 2024
5091fdf
update constraints
lorenzogentile404 Dec 16, 2024
434efdf
add scheduleForPostTransaction
lorenzogentile404 Dec 16, 2024
be74516
remove senderAfterPayingForValue
lorenzogentile404 Dec 16, 2024
6516296
extract gas cost
lorenzogentile404 Dec 16, 2024
702bb0d
complete initialization section
lorenzogentile404 Dec 16, 2024
3b4ab73
add comment
lorenzogentile404 Dec 17, 2024
73d58e1
improve naming in finalization section
lorenzogentile404 Dec 17, 2024
05e636c
Merge branch 'arith-dev' into 1648-initialization-and-finalization-se…
lorenzogentile404 Dec 18, 2024
68ded90
update constraints
lorenzogentile404 Dec 18, 2024
67e8d37
add comments
lorenzogentile404 Dec 19, 2024
8395e61
fix: record HUB_STAMP for future undoing
OlivierBBB Dec 20, 2024
6efb41c
ras
OlivierBBB Dec 20, 2024
4a589f7
fix: the final context fragment has to be created at the start
OlivierBBB Dec 20, 2024
0f99eb1
fix: DOM/SUB stamps of the revert have to use the logged hubStamp
OlivierBBB Dec 20, 2024
dee2a02
ras: made isSelfCredit(Hub) a method
OlivierBBB Dec 20, 2024
5bdc188
fix: the balance increment was off
OlivierBBB Dec 20, 2024
d9ed236
fix: 3 DOM/SUB stamps are required initially, not 2
OlivierBBB Dec 20, 2024
a1a539e
ras
OlivierBBB Dec 20, 2024
bfa376e
ras
OlivierBBB Dec 20, 2024
3ab757c
fix: more on initialization
OlivierBBB Dec 20, 2024
6c619e8
ras: wtarted working on finalization
OlivierBBB Dec 20, 2024
ecfe283
ras: scheduleForPostTransaction => scheduleForEndTransation
OlivierBBB Dec 20, 2024
2de827b
ras: isSelfCredit => senderIsRecipient
OlivierBBB Dec 20, 2024
598aa40
fix: TX_FINL implementation
OlivierBBB Dec 20, 2024
f78cefd
ras: names + other
OlivierBBB Dec 20, 2024
1de6ceb
ras: switch to master for constraints in order to merge arith-dev
OlivierBBB Dec 21, 2024
2fe7122
Merge branch 'arith-dev' into 1648-initialization-and-finalization-se…
OlivierBBB Dec 21, 2024
5f0e9d0
ras: regenerate the Trace.java files for HUB and BLOCKDATA
OlivierBBB Dec 21, 2024
ba53335
fix: the TX_INIT section requires to scheduleForContextEntry its MISC…
OlivierBBB Dec 21, 2024
f792492
fix: type change in the HUB
OlivierBBB Dec 21, 2024
112f1f8
fix: schedule the TX_INIT's MISC fragment for ContextEntry and allowi…
OlivierBBB Dec 21, 2024
b220d70
fix: rebuilt trace files
OlivierBBB Dec 21, 2024
dfbd9fe
fix: using ETHEREUM_GAS_LIMIT_XXX constants
OlivierBBB Dec 21, 2024
85cbcc2
fix: constraints update
OlivierBBB Dec 21, 2024
065fa0a
ras: constraints commit update
OlivierBBB Dec 21, 2024
ca8c42e
feat: more ignored tests
OlivierBBB Dec 22, 2024
d91bef9
fix: ignore MODEXP tests where bbs, ebs or mbs is > 512
OlivierBBB Dec 22, 2024
c774dbd
Merge branch 'arith-dev' into 1648-initialization-and-finalization-se…
OlivierBBB Dec 23, 2024
3dd541d
fix: erroneous traceEndConflation in CorsetBlockProcessor
OlivierBBB Dec 23, 2024
a62ca6c
fix: raise jupiter timeout to 15 minutes
OlivierBBB Dec 23, 2024
fc2495f
ras: direct method for CFI extraction
OlivierBBB Dec 23, 2024
ee1dc36
ras: remove redundant `setWarmthTo(true)`
OlivierBBB Dec 23, 2024
100d2b4
fix: more ignored tests
OlivierBBB Dec 23, 2024
50e33ad
ras
OlivierBBB Dec 23, 2024
c87b6e1
ras: simplified refund computation
OlivierBBB Dec 23, 2024
bbfd769
fix: constraints SSTORE fix + ras
OlivierBBB Dec 23, 2024
9cb31de
update constraints
lorenzogentile404 Dec 23, 2024
e7c6cb9
Merge branch '1648-initialization-and-finalization-sections-fix' of g…
lorenzogentile404 Dec 23, 2024
3fe53bc
fix: more ignored tests (deployment tx leads to collision)
OlivierBBB Dec 24, 2024
87f3189
ras: minor changes in TX_INIT
OlivierBBB Dec 24, 2024
ad98d73
feat: ignoring a test triggering EIP-7610
OlivierBBB Jan 6, 2025
19b1dc4
spotless
OlivierBBB Jan 6, 2025
65bea4d
feat: ignoring a test (see #1678)
OlivierBBB Jan 6, 2025
7eb8311
ras
OlivierBBB Jan 6, 2025
5df8027
fix: the "1th value 256 does not fit a byte" issue
OlivierBBB Jan 6, 2025
02174ce
feat: ignoring the last tests blowing up the BLOCKDATA module
OlivierBBB Jan 6, 2025
4ac44cd
ras: basic print statement for MODEXP calls with illegal arguments
OlivierBBB Jan 7, 2025
3985b87
ras: extracted test from Reference tests
OlivierBBB Jan 7, 2025
76bbf00
feat: more test vectors that we ignore
OlivierBBB Jan 7, 2025
f1d9cd9
fix: updating constraints commit
OlivierBBB Jan 7, 2025
c2b9aed
ras: switch from ETHEREUM_GAS_LIMI_XXX back to LINEA_GAS_LIMIT_XXX co…
OlivierBBB Jan 7, 2025
ce439c0
spotless
OlivierBBB Jan 7, 2025
a713b27
fix: new boolean "coinbaseWarmthAtTransactionEnd" field in HUB
OlivierBBB Jan 8, 2025
3bb8806
fix: safe addition for upper bound of GAS_LIMIT computation in BLOCKDATA
OlivierBBB Jan 8, 2025
6bbe144
fix: in BLOCKDATA maxDeviation must be made unsigned
OlivierBBB Jan 8, 2025
e7ee5e6
ras
OlivierBBB Jan 8, 2025
b802d02
fix: reworking of the TxSkipSection
OlivierBBB Jan 8, 2025
8110cad
fix(disgusting): coinbaseAddress in HUB
OlivierBBB Jan 8, 2025
a651788
fix: use the Hub#coinbaseAddress in BLOCKDATA
OlivierBBB Jan 8, 2025
3e258b2
fix: use the Hub#coinbaseAddress in TransactionFragment's
OlivierBBB Jan 8, 2025
fbeaa88
fix: use the Hub#coinbaseAddress in TXN_DATA
OlivierBBB Jan 8, 2025
697ad85
fix: update constraints commit
OlivierBBB Jan 8, 2025
a9aa899
spotless
OlivierBBB Jan 8, 2025
f305247
Merge branch 'arith-dev' into 1648-initialization-and-finalization-se…
OlivierBBB Jan 9, 2025
ac81f3f
fix: constraints commit update
OlivierBBB Jan 9, 2025
0803622
fix(disgusting): coinbaseAddress in TX_INIT + associated reworking
OlivierBBB Jan 9, 2025
0d084d7
spotless
OlivierBBB Jan 9, 2025
c6dad89
update self-hosted runner instance
DavePearce Jan 9, 2025
6a97f45
update other self-hosted runner instances
DavePearce Jan 9, 2025
cc9ba67
ras: LINEA_GAS_LIMIT to ETHEREUM_GAS_LIMIT
OlivierBBB Jan 10, 2025
4101c7c
ras: back to LINEA_GAS_LIMIT_XXX
OlivierBBB Jan 10, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class Blockdata implements Module {
private int traceCounter = 0;
private long firstBlockNumber;
private Bytes chainId;
private boolean shouldBeTraced = true;

final OpCode[] opCodes = {
OpCode.COINBASE,
Expand Down Expand Up @@ -75,29 +76,35 @@ public void traceStartConflation(final long blockCount) {
public void traceEndBlock(final BlockHeader blockHeader, final BlockBody blockBody) {
final long blockNumber = blockHeader.getNumber();
firstBlockNumber = (traceCounter < opCodes.length) ? blockNumber : firstBlockNumber;
for (OpCode opCode : opCodes) {
BlockdataOperation operation =
new BlockdataOperation(
blockHeader,
prevBlockHeader,
txnData.currentBlock().getNbOfTxsInBlock(),
wcp,
euc,
chainId,
opCode,
firstBlockNumber);
operations.addLast(operation);
// Increase counter to track where we are in the conflation
traceCounter++;
if (shouldBeTraced) {
for (OpCode opCode : opCodes) {
BlockdataOperation operation =
new BlockdataOperation(
txnData.hub(),
blockHeader,
prevBlockHeader,
txnData.currentBlock().getNbOfTxsInBlock(),
wcp,
euc,
chainId,
opCode,
firstBlockNumber);
operations.addLast(operation);
// Increase counter to track where we are in the conflation
traceCounter++;
}
}
prevBlockHeader = blockHeader;
shouldBeTraced = false;
}

@Override
public void traceEndConflation(final WorldView state) {}

@Override
public void enterTransaction() {}
public void enterTransaction() {
shouldBeTraced = true;
}

@Override
public void popTransaction() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
import static net.consensys.linea.zktracer.module.constants.GlobalConstants.LLARGE;
import static net.consensys.linea.zktracer.module.constants.GlobalConstants.WCP_INST_GEQ;
import static net.consensys.linea.zktracer.module.constants.GlobalConstants.WCP_INST_LEQ;
import static net.consensys.linea.zktracer.module.constants.Trace.GAS_LIMIT_ADJUSTMENT_FACTOR;
import static net.consensys.linea.zktracer.module.constants.Trace.LINEA_GAS_LIMIT_MAXIMUM;
import static net.consensys.linea.zktracer.module.constants.Trace.LINEA_GAS_LIMIT_MINIMUM;
import static net.consensys.linea.zktracer.module.constants.Trace.*;
import static net.consensys.linea.zktracer.types.Conversions.booleanToBytes;

import java.math.BigInteger;
Expand All @@ -36,6 +34,7 @@
import lombok.experimental.Accessors;
import net.consensys.linea.zktracer.container.ModuleOperation;
import net.consensys.linea.zktracer.module.euc.Euc;
import net.consensys.linea.zktracer.module.hub.Hub;
import net.consensys.linea.zktracer.module.wcp.Wcp;
import net.consensys.linea.zktracer.opcode.OpCode;
import net.consensys.linea.zktracer.types.EWord;
Expand All @@ -46,6 +45,7 @@
@Accessors(fluent = true)
@Getter
public class BlockdataOperation extends ModuleOperation {
private final Hub hub;
private final Wcp wcp;
private final Euc euc;
private final Bytes chainId;
Expand All @@ -70,6 +70,7 @@ public class BlockdataOperation extends ModuleOperation {
private final boolean[] eucFlag;

public BlockdataOperation(
Hub hub,
BlockHeader blockHeader,
BlockHeader prevBlockHeader,
int relTxMax,
Expand All @@ -79,6 +80,7 @@ public BlockdataOperation(
OpCode opCode,
long firstBlockNumber) {
// Data from blockHeader
this.hub = hub;
this.blockHeader = blockHeader;
this.prevBlockHeader = prevBlockHeader;

Expand Down Expand Up @@ -131,7 +133,7 @@ public BlockdataOperation(
}

private void handleCoinbase() {
data = EWord.ofHexString(blockHeader.getCoinbase().toHexString());
data = EWord.ofHexString(hub.coinbaseAddress.toHexString());
// row i
wcpCallToLT(0, data, POWER_256_20);
}
Expand Down Expand Up @@ -173,14 +175,16 @@ private void handleGasLimit() {
wcpCallToGEQ(0, data, EWord.of(LINEA_GAS_LIMIT_MINIMUM));

// row i + 1
wcpCallToLEQ(1, data, EWord.of(LINEA_GAS_LIMIT_MAXIMUM));
wcpCallToLEQ(1, data, EWord.of(Bytes.ofUnsignedLong(LINEA_GAS_LIMIT_MAXIMUM)));

if (!firstBlockInConflation) {
EWord prevGasLimit = EWord.of(prevBlockHeader.getGasLimit());
// row i + 2
Bytes maxDeviation = eucCall(2, prevGasLimit, EWord.of(GAS_LIMIT_ADJUSTMENT_FACTOR));
// row i + 3
wcpCallToLT(3, data, EWord.of(prevGasLimit.toLong() + maxDeviation.toLong()));
BigInteger safeGasLimitUpperBound =
prevGasLimit.getAsBigInteger().add(maxDeviation.toUnsignedBigInteger());
wcpCallToLT(3, data, EWord.of(safeGasLimitUpperBound));

// row i + 4
wcpCallToGT(
Expand Down Expand Up @@ -223,10 +227,11 @@ public void trace(Trace trace) {
.isChainid(opCode == OpCode.CHAINID)
.isBasefee(opCode == OpCode.BASEFEE)
.inst(UnsignedByte.of(opCode.byteValue()))
.coinbaseHi(blockHeader.getCoinbase().slice(0, 4).toLong())
.coinbaseLo(blockHeader.getCoinbase().slice(4, LLARGE))
.blockGasLimit(blockHeader.getGasLimit())
.basefee(blockHeader.getBaseFee().get().getAsBigInteger().longValue())
.coinbaseHi(hub.coinbaseAddress.slice(0, 4).toLong())
.coinbaseLo(hub.coinbaseAddress.slice(4, LLARGE))
.blockGasLimit(Bytes.ofUnsignedLong(blockHeader.getGasLimit()))
.basefee(
Bytes.ofUnsignedLong(blockHeader.getBaseFee().get().getAsBigInteger().longValue()))
.firstBlockNumber(firstBlockNumber)
.relBlock((short) relBlock)
.relTxNumMax((short) relTxMax)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ static List<ColumnHeader> headers(int length) {
headers.add(new ColumnHeader("blockdata.ARG_1_LO", 16, length));
headers.add(new ColumnHeader("blockdata.ARG_2_HI", 16, length));
headers.add(new ColumnHeader("blockdata.ARG_2_LO", 16, length));
headers.add(new ColumnHeader("blockdata.BASEFEE", 6, length));
headers.add(new ColumnHeader("blockdata.BLOCK_GAS_LIMIT", 6, length));
headers.add(new ColumnHeader("blockdata.BASEFEE", 8, length));
headers.add(new ColumnHeader("blockdata.BLOCK_GAS_LIMIT", 8, length));
headers.add(new ColumnHeader("blockdata.COINBASE_HI", 4, length));
headers.add(new ColumnHeader("blockdata.COINBASE_LO", 16, length));
headers.add(new ColumnHeader("blockdata.CT", 1, length));
Expand All @@ -98,7 +98,7 @@ static List<ColumnHeader> headers(int length) {
headers.add(new ColumnHeader("blockdata.IS_GASLIMIT", 1, length));
headers.add(new ColumnHeader("blockdata.IS_NUMBER", 1, length));
headers.add(new ColumnHeader("blockdata.IS_TIMESTAMP", 1, length));
headers.add(new ColumnHeader("blockdata.REL_BLOCK", 1, length));
headers.add(new ColumnHeader("blockdata.REL_BLOCK", 2, length));
headers.add(new ColumnHeader("blockdata.REL_TX_NUM_MAX", 2, length));
headers.add(new ColumnHeader("blockdata.RES", 16, length));
headers.add(new ColumnHeader("blockdata.WCP_FLAG", 1, length));
Expand Down Expand Up @@ -248,42 +248,54 @@ public Trace arg2Lo(final Bytes b) {
return this;
}

public Trace basefee(final long b) {
public Trace basefee(final Bytes b) {
if (filled.get(4)) {
throw new IllegalStateException("blockdata.BASEFEE already set");
} else {
filled.set(4);
}

if (b >= 281474976710656L) {
throw new IllegalArgumentException("blockdata.BASEFEE has invalid value (" + b + ")");
// Trim array to size
Bytes bs = b.trimLeadingZeros();
// Sanity check against expected width
if (bs.bitLength() > 64) {
throw new IllegalArgumentException(
"blockdata.BASEFEE has invalid width (" + bs.bitLength() + "bits)");
}
// Write padding (if necessary)
for (int i = bs.size(); i < 8; i++) {
basefee.put((byte) 0);
}
// Write bytes
for (int j = 0; j < bs.size(); j++) {
basefee.put(bs.get(j));
}
basefee.put((byte) (b >> 40));
basefee.put((byte) (b >> 32));
basefee.put((byte) (b >> 24));
basefee.put((byte) (b >> 16));
basefee.put((byte) (b >> 8));
basefee.put((byte) b);

return this;
}

public Trace blockGasLimit(final long b) {
public Trace blockGasLimit(final Bytes b) {
if (filled.get(5)) {
throw new IllegalStateException("blockdata.BLOCK_GAS_LIMIT already set");
} else {
filled.set(5);
}

if (b >= 281474976710656L) {
throw new IllegalArgumentException("blockdata.BLOCK_GAS_LIMIT has invalid value (" + b + ")");
// Trim array to size
Bytes bs = b.trimLeadingZeros();
// Sanity check against expected width
if (bs.bitLength() > 64) {
throw new IllegalArgumentException(
"blockdata.BLOCK_GAS_LIMIT has invalid width (" + bs.bitLength() + "bits)");
}
// Write padding (if necessary)
for (int i = bs.size(); i < 8; i++) {
blockGasLimit.put((byte) 0);
}
// Write bytes
for (int j = 0; j < bs.size(); j++) {
blockGasLimit.put(bs.get(j));
}
blockGasLimit.put((byte) (b >> 40));
blockGasLimit.put((byte) (b >> 32));
blockGasLimit.put((byte) (b >> 24));
blockGasLimit.put((byte) (b >> 16));
blockGasLimit.put((byte) (b >> 8));
blockGasLimit.put((byte) b);

return this;
}
Expand Down Expand Up @@ -574,9 +586,10 @@ public Trace relBlock(final long b) {
filled.set(24);
}

if (b >= 256L) {
if (b >= 65536L) {
throw new IllegalArgumentException("blockdata.REL_BLOCK has invalid value (" + b + ")");
}
relBlock.put((byte) (b >> 8));
relBlock.put((byte) b);

return this;
Expand All @@ -589,7 +602,7 @@ public Trace relTxNumMax(final long b) {
filled.set(25);
}

if (b >= 1024L) {
if (b >= 65536L) {
throw new IllegalArgumentException("blockdata.REL_TX_NUM_MAX has invalid value (" + b + ")");
}
relTxNumMax.put((byte) (b >> 8));
Expand Down Expand Up @@ -773,11 +786,11 @@ public Trace fillAndValidateRow() {
}

if (!filled.get(4)) {
basefee.position(basefee.position() + 6);
basefee.position(basefee.position() + 8);
}

if (!filled.get(5)) {
blockGasLimit.position(blockGasLimit.position() + 6);
blockGasLimit.position(blockGasLimit.position() + 8);
}

if (!filled.get(6)) {
Expand Down Expand Up @@ -853,7 +866,7 @@ public Trace fillAndValidateRow() {
}

if (!filled.get(24)) {
relBlock.position(relBlock.position() + 1);
relBlock.position(relBlock.position() + 2);
}

if (!filled.get(25)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public class Trace {
new BigInteger("302652579918965577886386472538583578916");
public static final BigInteger EMPTY_SHA2_LO =
new BigInteger("52744687940778649747319168982913824853");
public static final long ETHEREUM_GAS_LIMIT_MAXIMUM = 0xffffffffffffffffL;
public static final int ETHEREUM_GAS_LIMIT_MINIMUM = 0x1388;
public static final int EVM_INST_ADD = 0x1;
public static final int EVM_INST_ADDMOD = 0x8;
public static final int EVM_INST_ADDRESS = 0x30;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public int lineCount() {
private final RlpTxn rlpTxn = new RlpTxn(romLex);
private final Mmio mmio;

private final TxnData txnData = new TxnData(wcp, euc);
private final TxnData txnData = new TxnData(this, wcp, euc);
private final RlpTxnRcpt rlpTxnRcpt = new RlpTxnRcpt();
private final LogInfo logInfo = new LogInfo(rlpTxnRcpt);
private final LogData logData = new LogData(rlpTxnRcpt);
Expand Down Expand Up @@ -294,6 +294,9 @@ private List<Module> precompileLimitModules() {
*/
public boolean failureConditionForCreates = false;

public Address coinbaseAddress;
public boolean coinbaseWarmthAtTransactionEnd = false;

/**
* @return a list of all modules for which to generate traces
*/
Expand Down Expand Up @@ -496,6 +499,7 @@ public void traceStartTransaction(final WorldView world, final Transaction tx) {

if (!transactionProcessingMetadata.requiresEvmExecution()) {
state.setProcessingPhase(TX_SKIP);
Address coinbaseAddress = Address.fromHexString("8f81e2e3f8b46467523463835f965ffe476e1c9e");
new TxSkipSection(this, world, transactionProcessingMetadata, transients);
} else {
if (transactionProcessingMetadata.requiresPrewarming()) {
Expand All @@ -516,6 +520,8 @@ public void traceStartTransaction(final WorldView world, final Transaction tx) {
}
}

// the sender already received its gas refund
// the coinbase already received its gas reward
public void traceEndTransaction(
WorldView world,
Transaction tx,
Expand All @@ -529,7 +535,7 @@ public void traceEndTransaction(

txStack.current().completeLineaTransaction(this, isSuccessful, logs, selfDestructs);

defers.resolvePostTransaction(this, world, tx, isSuccessful);
defers.resolveAtEndTransaction(this, world, tx, isSuccessful);

// Warn: we need to call MMIO after resolving the defers
for (Module m : modules) {
Expand All @@ -546,6 +552,11 @@ public void traceContextEnter(MessageFrame frame) {

// root and transaction call data context's
if (frame.getDepth() == 0) {
coinbaseAddress = frame.getMiningBeneficiary();
if (state.getProcessingPhase() == TX_SKIP) {
checkState(currentTraceSection() instanceof TxSkipSection);
((TxSkipSection) currentTraceSection()).coinbaseSnapshots(this, frame);
}
final TransactionProcessingMetadata currentTransaction = transients().tx();
final Address recipientAddress = frame.getRecipientAddress();
final Address senderAddress = frame.getSenderAddress();
Expand Down Expand Up @@ -633,12 +644,12 @@ public void traceContextEnter(MessageFrame frame) {

this.currentFrame().initializeFrame(frame);

defers.resolveUponContextEntry(this, frame);

for (Module m : modules) {
m.traceContextEnter(frame);
}
}

defers.resolveUponContextEntry(this, frame);
}

@Override
Expand All @@ -651,14 +662,13 @@ public void traceContextExit(MessageFrame frame) {
if (frame.getDepth() == 0) {
final long leftOverGas = frame.getRemainingGas();
final long gasRefund = frame.getGasRefund();
final boolean coinbaseIsWarm = frame.isAddressWarm(txStack.current().getCoinbase());

txStack
.current()
.setPreFinalisationValues(
leftOverGas,
gasRefund,
coinbaseIsWarm,
coinbaseWarmthAtTransactionEnd,
txStack.getAccumulativeGasUsedInBlockBeforeTxStart());

if (state.getProcessingPhase() != TX_SKIP
Expand Down Expand Up @@ -735,6 +745,7 @@ public void tracePostExecution(MessageFrame frame, Operation.OperationResult ope

if (frame.getDepth() == 0 && (isExceptional() || opCode() == REVERT)) {
this.state.setProcessingPhase(TX_FINL);
coinbaseWarmthAtTransactionEnd = frame.isAddressWarm(coinbaseAddress);
new TxFinalizationSection(this, frame.getWorldUpdater(), true);
}
}
Expand Down
Loading
Loading