Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 5 additions & 6 deletions node/derivation/batch_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ func (b *BlockContext) Decode(bc []byte) error {
if err != nil {
return err
}
b.Number = wb.Number
b.BaseFee = wb.BaseFee
b.GasLimit = wb.GasLimit
b.txsNum = txsNum
b.l1MsgNum = l1MsgNum
b.Timestamp = wb.Timestamp
b.coinbase = wb.Miner
return nil
}
Expand Down Expand Up @@ -168,7 +170,6 @@ func (bi *BatchInfo) ParseBatch(batch geth.RPCRollupBatch, morph204Time uint64)
if err := block.Decode(bcBytes); err != nil {
return fmt.Errorf("decode number and timestamp error: %v", err)
}
var coinbase common.Address
// handle coinbase
if morph204Time == 0 || block.Timestamp >= morph204Time {
coinbaseBytes := make([]byte, common.AddressLength)
Expand All @@ -177,10 +178,11 @@ func (bi *BatchInfo) ParseBatch(batch geth.RPCRollupBatch, morph204Time uint64)
return fmt.Errorf("read skipped block context error:%s", err.Error())
}

coinbase, err = decodeCoinbase(coinbaseBytes)
coinbase, err := decodeCoinbase(coinbaseBytes)
if err != nil {
return err
}
block.coinbase = coinbase
}

// Set boundary block numbers
Expand All @@ -197,8 +199,7 @@ func (bi *BatchInfo) ParseBatch(batch geth.RPCRollupBatch, morph204Time uint64)
safeL2Data.GasLimit = block.GasLimit
safeL2Data.BaseFee = block.BaseFee
safeL2Data.Timestamp = block.Timestamp
// TODO coinbase
fmt.Println(coinbase)
safeL2Data.Miner = block.coinbase

// Handle zero BaseFee case
if block.BaseFee != nil && block.BaseFee.Cmp(big.NewInt(0)) == 0 {
Expand All @@ -214,7 +215,6 @@ func (bi *BatchInfo) ParseBatch(batch geth.RPCRollupBatch, morph204Time uint64)
block.SafeL2Data = &safeL2Data
blockContexts[i] = &block
}

// Read transaction data
txsData, err := io.ReadAll(reader)
if err != nil {
Expand All @@ -229,7 +229,6 @@ func (bi *BatchInfo) ParseBatch(batch geth.RPCRollupBatch, morph204Time uint64)

// Process transactions
tq.enqueue(data)

for i := 0; i < int(blockCount); i++ {
// Skip if index is out of bounds
if i >= len(blockContexts) {
Expand Down
2 changes: 1 addition & 1 deletion node/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/golang-lru v1.0.2
github.com/klauspost/compress v1.17.9
github.com/morph-l2/go-ethereum v1.10.14-0.20250425070859-09af684fe1f3
github.com/morph-l2/go-ethereum v1.10.14-0.20250428081328-6f1d6b6d7fbc
github.com/prometheus/client_golang v1.17.0
github.com/spf13/viper v1.13.0
github.com/stretchr/testify v1.9.0
Expand Down
4 changes: 2 additions & 2 deletions node/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqky
github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/morph-l2/go-ethereum v1.10.14-0.20250425070859-09af684fe1f3 h1:JKzLjIra43KfRXDDZEcypcFOZixWMnXtFmLaxUOStYY=
github.com/morph-l2/go-ethereum v1.10.14-0.20250425070859-09af684fe1f3/go.mod h1:sMJCfHOBzVRDkM2yF/Hy+oUk2rgC0CQZHTLs0cyzhhk=
github.com/morph-l2/go-ethereum v1.10.14-0.20250428081328-6f1d6b6d7fbc h1:6/PIvEm6SV4ilM19vo1LiMtRS/ARRJpbdivWMr+C0Vk=
github.com/morph-l2/go-ethereum v1.10.14-0.20250428081328-6f1d6b6d7fbc/go.mod h1:sMJCfHOBzVRDkM2yF/Hy+oUk2rgC0CQZHTLs0cyzhhk=
github.com/morph-l2/tendermint v0.3.2-0.20250115141431-c84dfe5c8533 h1:qhBMCyTQ/ezOpeqHGKjr4qSN/B/bGFByuYjQqDt5wiw=
github.com/morph-l2/tendermint v0.3.2-0.20250115141431-c84dfe5c8533/go.mod h1:TtCzp9l6Z6yDUiwv3TbqKqw8Q8RKp3fSz5+adO1/Y8w=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
Expand Down
Loading