Skip to content

Commit

Permalink
update to support fork8 sync (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
zjg555543 authored Apr 12, 2024
1 parent 2455d26 commit aaab4fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions state/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,9 @@ func GenerateReceipt(blockNumber *big.Int, processedTx *ProcessTransactionRespon
ContractAddress: processedTx.CreateAddress,
Logs: processedTx.Logs,
}
if forkID <= FORKID_ETROG {

// for XLayer
if forkID <= FORKID_ELDERBERRY {
receipt.PostState = processedTx.StateRoot.Bytes()
receipt.CumulativeGasUsed = processedTx.GasUsed
} else {
Expand All @@ -311,7 +313,9 @@ func GenerateReceipt(blockNumber *big.Int, processedTx *ProcessTransactionRespon
for i := 0; i < len(receipt.Logs); i++ {
receipt.Logs[i].TxHash = processedTx.Tx.Hash()
}
if forkID <= FORKID_ETROG {

// for XLayer
if forkID <= FORKID_ELDERBERRY {
if processedTx.RomError == nil {
receipt.Status = types.ReceiptStatusSuccessful
} else {
Expand Down
2 changes: 1 addition & 1 deletion state/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func (s *State) StoreL2Block(ctx context.Context, batchNumber uint64, l2Block *P

gasLimit := l2Block.GasLimit
// We check/set the maximum value of gasLimit for batches <= to ETROG fork. For batches >= to ELDERBERRY fork we use always the value returned by the executor
if forkID <= FORKID_ETROG && gasLimit > MaxL2BlockGasLimit {
if forkID <= FORKID_ELDERBERRY && gasLimit > MaxL2BlockGasLimit {
gasLimit = MaxL2BlockGasLimit
}

Expand Down

0 comments on commit aaab4fa

Please sign in to comment.