Skip to content

Commit

Permalink
Merge branch 'zkevm' into zkevm-2.60
Browse files Browse the repository at this point in the history
# Conflicts:
#	zk/stages/stage_sequence_execute_blocks.go
  • Loading branch information
hexoscott committed Oct 9, 2024
2 parents be67448 + e4a34d7 commit 30887e1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
4 changes: 3 additions & 1 deletion core/blockchain_zkevm.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ func ExecuteBlockEphemerallyZk(
}

localReceipt := CreateReceiptForBlockInfoTree(receipt, chainConfig, blockNum, execResult)
ProcessReceiptForBlockExecution(receipt, roHermezDb, chainConfig, blockNum, header, tx)
if err = ProcessReceiptForBlockExecution(receipt, roHermezDb, chainConfig, blockNum, header, tx); err != nil {
return nil, err
}

if err != nil {
if !vmConfig.StatelessExec {
Expand Down
7 changes: 6 additions & 1 deletion core/types/log_zkevm.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,15 @@ func (_this *Log) Clone() *Log {
}

func (_this *Log) ApplyPaddingToLogsData(isForkId8, isForkId12 bool) {
if isForkId12 {
// we want to skip this behaviour completely for fork 12
return
}

d := _this.Data
mSize := len(d)

if isForkId8 && !isForkId12 {
if isForkId8 {
d = applyHexPadBug(d, mSize)
} else {
// [zkEvm] fill 0 at the end
Expand Down
8 changes: 2 additions & 6 deletions zk/stages/stage_sequence_execute_blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/ledgerwatch/erigon/zk/erigon_db"
"github.com/ledgerwatch/erigon/zk/hermez_db"
zktypes "github.com/ledgerwatch/erigon/zk/types"
"github.com/ledgerwatch/erigon/zk/utils"
"github.com/ledgerwatch/secp256k1"
)

Expand Down Expand Up @@ -157,12 +158,6 @@ func finaliseBlock(
return nil, err
}

if batchState.isL1Recovery() {
for i, receipt := range builtBlockElements.receipts {
core.ProcessReceiptForBlockExecution(receipt, batchContext.sdb.hermezDb.HermezDbReader, batchContext.cfg.chainConfig, newHeader.Number.Uint64(), newHeader, builtBlockElements.transactions[i])
}
}

var withdrawals []*types.Withdrawal
if batchContext.cfg.chainConfig.IsShanghai(newHeader.Number.Uint64()) {
withdrawals = []*types.Withdrawal{}
Expand Down Expand Up @@ -196,6 +191,7 @@ func finaliseBlock(
finalHeader := finalBlock.HeaderNoCopy()
finalHeader.Root = newRoot
finalHeader.Coinbase = batchState.getCoinbase(batchContext.cfg)
finalHeader.GasLimit = utils.GetBlockGasLimitForFork(batchState.forkId)
finalHeader.ReceiptHash = types.DeriveSha(builtBlockElements.receipts)
finalHeader.Bloom = types.CreateBloom(builtBlockElements.receipts)
newNum := finalBlock.Number()
Expand Down

0 comments on commit 30887e1

Please sign in to comment.