From 4f31c2fd505f9f6b4d363ab67deace44fb03b3ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Ram=C3=ADrez?= <58293609+ToniRamirezM@users.noreply.github.com> Date: Wed, 16 Mar 2022 11:21:20 +0100 Subject: [PATCH] Store Local Exit Root (#485) * Store Local Exit Root * comment fixes * comment fixes --- cmd/register.go | 6 +- cmd/run.go | 6 +- config/network-config.example.json | 2 + config/network.go | 94 +++++++++++++++----------- db/migrations/0001.sql | 1 + state/batch.go | 1 + state/batchprocessor.go | 8 +++ state/config.go | 6 ++ state/pgstatestorage/pgstatestorage.go | 28 ++++---- 9 files changed, 94 insertions(+), 58 deletions(-) diff --git a/cmd/register.go b/cmd/register.go index b7fe89abfb..52a51a4e41 100644 --- a/cmd/register.go +++ b/cmd/register.go @@ -56,8 +56,10 @@ func registerSequencer(ctx *cli.Context) error { tr := tree.NewStateTree(mt, scCodeStore) stateCfg := state.Config{ - DefaultChainID: c.NetworkConfig.L2DefaultChainID, - MaxCumulativeGasUsed: c.NetworkConfig.MaxCumulativeGasUsed, + DefaultChainID: c.NetworkConfig.L2DefaultChainID, + MaxCumulativeGasUsed: c.NetworkConfig.MaxCumulativeGasUsed, + L2GlobalExitRootManagerAddr: c.NetworkConfig.L2GlobalExitRootManagerAddr, + L2GlobalExitRootManagerPosition: c.NetworkConfig.L2GlobalExitRootManagerPosition, } stateDb := pgstatestorage.NewPostgresStorage(sqlDB) diff --git a/cmd/run.go b/cmd/run.go index 8d9c6aabe2..5a7f0f4ebf 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -66,8 +66,10 @@ func start(ctx *cli.Context) error { tr := tree.NewStateTree(mt, scCodeStore) stateCfg := state.Config{ - DefaultChainID: c.NetworkConfig.L2DefaultChainID, - MaxCumulativeGasUsed: c.NetworkConfig.MaxCumulativeGasUsed, + DefaultChainID: c.NetworkConfig.L2DefaultChainID, + MaxCumulativeGasUsed: c.NetworkConfig.MaxCumulativeGasUsed, + L2GlobalExitRootManagerAddr: c.NetworkConfig.L2GlobalExitRootManagerAddr, + L2GlobalExitRootManagerPosition: c.NetworkConfig.L2GlobalExitRootManagerPosition, } stateDb := pgstatestorage.NewPostgresStorage(sqlDB) diff --git a/config/network-config.example.json b/config/network-config.example.json index 34fa08120a..b829437628 100644 --- a/config/network-config.example.json +++ b/config/network-config.example.json @@ -3,6 +3,8 @@ "genBlockNumber": 1, "poeAddr": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9", "maticAddr": "0x37AffAf737C3683aB73F6E1B0933b725Ab9796Aa", + "l2globalExitRootManagerAddr": "0x0000000000000000000000000000000000000000", + "l2globalExitRootManagerPosition": 2, "l1ChainID": 1337, "l2DefaultChainID": 1000, "balances": { diff --git a/config/network.go b/config/network.go index e73ceb4bfa..196d84ba18 100644 --- a/config/network.go +++ b/config/network.go @@ -15,25 +15,29 @@ import ( //NetworkConfig is the configuration struct for the different environments type NetworkConfig struct { - Arity uint8 - GenBlockNumber uint64 - PoEAddr common.Address - MaticAddr common.Address - L1ChainID uint64 - L2DefaultChainID uint64 - Balances map[common.Address]*big.Int - MaxCumulativeGasUsed uint64 + Arity uint8 + GenBlockNumber uint64 + PoEAddr common.Address + MaticAddr common.Address + L2GlobalExitRootManagerAddr common.Address + L2GlobalExitRootManagerPosition uint64 + L1ChainID uint64 + L2DefaultChainID uint64 + Balances map[common.Address]*big.Int + MaxCumulativeGasUsed uint64 } type networkConfigFromJSON struct { - Arity uint8 `json:"arity"` - GenBlockNumber uint64 `json:"genBlockNumber"` - PoEAddr string `json:"poeAddr"` - MaticAddr string `json:"maticAddr"` - L1ChainID uint64 `json:"l1ChainID"` - L2DefaultChainID uint64 `json:"l2DefaultChainID"` - Balances map[string]string `json:"balances"` - MaxCumulativeGasUsed uint64 `json:"maxCumulativeGasUsed"` + Arity uint8 `json:"arity"` + GenBlockNumber uint64 `json:"genBlockNumber"` + PoEAddr string `json:"poeAddr"` + MaticAddr string `json:"maticAddr"` + L2GlobalExitRootManagerAddr string `json:"l2globalExitRootManagerAddr"` + L2GlobalExitRootManagerPosition uint64 `json:"l2globalExitRootManagerPosition"` + L1ChainID uint64 `json:"l1ChainID"` + L2DefaultChainID uint64 `json:"l2DefaultChainID"` + Balances map[string]string `json:"balances"` + MaxCumulativeGasUsed uint64 `json:"maxCumulativeGasUsed"` } const ( @@ -46,12 +50,14 @@ const ( //nolint:gomnd var ( mainnetConfig = NetworkConfig{ - Arity: 4, - GenBlockNumber: 13808430, - PoEAddr: common.HexToAddress("0x11D0Dc8E2Ce3a93EB2b32f4C7c3fD9dDAf1211FA"), - MaticAddr: common.HexToAddress("0x37AffAf737C3683aB73F6E1B0933b725Ab9796Aa"), - L1ChainID: 1, //Mainnet - L2DefaultChainID: 10000, + Arity: 4, + GenBlockNumber: 13808430, + PoEAddr: common.HexToAddress("0x11D0Dc8E2Ce3a93EB2b32f4C7c3fD9dDAf1211FA"), + MaticAddr: common.HexToAddress("0x37AffAf737C3683aB73F6E1B0933b725Ab9796Aa"), + L2GlobalExitRootManagerAddr: common.HexToAddress("0x0000000000000000000000000000000000000000"), + L2GlobalExitRootManagerPosition: 2, + L1ChainID: 1, //Mainnet + L2DefaultChainID: 10000, Balances: map[common.Address]*big.Int{ common.HexToAddress("0xb1D0Dc8E2Ce3a93EB2b32f4C7c3fD9dDAf1211FA"): big.NewInt(1000), common.HexToAddress("0xb1D0Dc8E2Ce3a93EB2b32f4C7c3fD9dDAf1211FB"): big.NewInt(2000), @@ -59,12 +65,14 @@ var ( MaxCumulativeGasUsed: 800000, } testnetConfig = NetworkConfig{ - Arity: 4, - GenBlockNumber: 9817974, - PoEAddr: common.HexToAddress("0x21D0Dc8E2Ce3a93EB2b32f4C7c3fD9dDAf1211FA"), - MaticAddr: common.HexToAddress("0x37AffAf737C3683aB73F6E1B0933b725Ab9796Aa"), - L1ChainID: 4, //Rinkeby - L2DefaultChainID: 40000, + Arity: 4, + GenBlockNumber: 9817974, + PoEAddr: common.HexToAddress("0x21D0Dc8E2Ce3a93EB2b32f4C7c3fD9dDAf1211FA"), + MaticAddr: common.HexToAddress("0x37AffAf737C3683aB73F6E1B0933b725Ab9796Aa"), + L2GlobalExitRootManagerAddr: common.HexToAddress("0x0000000000000000000000000000000000000000"), + L2GlobalExitRootManagerPosition: 2, + L1ChainID: 4, //Rinkeby + L2DefaultChainID: 40000, Balances: map[common.Address]*big.Int{ common.HexToAddress("0xb1D0Dc8E2Ce3a93EB2b32f4C7c3fD9dDAf1211FA"): big.NewInt(1000), common.HexToAddress("0xb1D0Dc8E2Ce3a93EB2b32f4C7c3fD9dDAf1211FB"): big.NewInt(2000), @@ -72,12 +80,14 @@ var ( MaxCumulativeGasUsed: 800000, } internalTestnetConfig = NetworkConfig{ - Arity: 4, - GenBlockNumber: 6279130, - PoEAddr: common.HexToAddress("0xaD9d51A5B5237aC36cF9d5f78EA84F8a79d3a274"), - MaticAddr: common.HexToAddress("0xA8d4b3CA3e49dCE738E5E29DfcF78499FE7312C9"), - L1ChainID: 5, //Goerli - L2DefaultChainID: 1000, + Arity: 4, + GenBlockNumber: 6279130, + PoEAddr: common.HexToAddress("0xaD9d51A5B5237aC36cF9d5f78EA84F8a79d3a274"), + MaticAddr: common.HexToAddress("0xA8d4b3CA3e49dCE738E5E29DfcF78499FE7312C9"), + L2GlobalExitRootManagerAddr: common.HexToAddress("0x0000000000000000000000000000000000000000"), + L2GlobalExitRootManagerPosition: 2, + L1ChainID: 5, //Goerli + L2DefaultChainID: 1000, Balances: map[common.Address]*big.Int{ common.HexToAddress("0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D"): bigIntFromBase10String("1000000000000000000000"), common.HexToAddress("0x4d5Cf5032B2a844602278b01199ED191A86c93ff"): bigIntFromBase10String("1000000000000000000000"), @@ -120,12 +130,14 @@ var ( MaxCumulativeGasUsed: 800000, } localConfig = NetworkConfig{ - Arity: 4, - GenBlockNumber: 1, - PoEAddr: common.HexToAddress("0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9"), - MaticAddr: common.HexToAddress("0x5FbDB2315678afecb367f032d93F642f64180aa3"), - L1ChainID: 1337, - L2DefaultChainID: 1000, + Arity: 4, + GenBlockNumber: 1, + PoEAddr: common.HexToAddress("0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9"), + MaticAddr: common.HexToAddress("0x5FbDB2315678afecb367f032d93F642f64180aa3"), + L2GlobalExitRootManagerAddr: common.HexToAddress("0x0000000000000000000000000000000000000000"), + L2GlobalExitRootManagerPosition: 2, + L1ChainID: 1337, + L2DefaultChainID: 1000, Balances: map[common.Address]*big.Int{ common.HexToAddress("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"): bigIntFromBase10String("1000000000000000000000"), common.HexToAddress("0x70997970C51812dc3A010C7d01b50e0d17dc79C8"): bigIntFromBase10String("1000000000000000000000"), @@ -214,6 +226,8 @@ func loadCustomNetworkConfig(ctx *cli.Context) (NetworkConfig, error) { cfg.GenBlockNumber = cfgJSON.GenBlockNumber cfg.PoEAddr = common.HexToAddress(cfgJSON.PoEAddr) cfg.MaticAddr = common.HexToAddress(cfgJSON.MaticAddr) + cfg.L2GlobalExitRootManagerAddr = common.HexToAddress(cfgJSON.L2GlobalExitRootManagerAddr) + cfg.L2GlobalExitRootManagerPosition = cfgJSON.L2GlobalExitRootManagerPosition cfg.L1ChainID = cfgJSON.L1ChainID cfg.L2DefaultChainID = cfgJSON.L2DefaultChainID cfg.Balances = make(map[common.Address]*big.Int, len(cfgJSON.Balances)) diff --git a/db/migrations/0001.sql b/db/migrations/0001.sql index ce42a2c92d..f9bd185c56 100644 --- a/db/migrations/0001.sql +++ b/db/migrations/0001.sql @@ -25,6 +25,7 @@ CREATE TABLE state.batch matic_collateral NUMERIC(78,0), chain_id BIGINT, global_exit_root BYTEA, + rollup_exit_root BYTEA, received_at TIMESTAMP WITH TIME ZONE NOT NULL, consolidated_at TIMESTAMP WITH TIME ZONE diff --git a/state/batch.go b/state/batch.go index 1af62ad275..80463adbad 100644 --- a/state/batch.go +++ b/state/batch.go @@ -24,6 +24,7 @@ type Batch struct { ConsolidatedTxHash common.Hash ChainID *big.Int GlobalExitRoot common.Hash + RollupExitRoot common.Hash Header *types.Header Uncles []*types.Header Transactions []*types.Transaction diff --git a/state/batchprocessor.go b/state/batchprocessor.go index 4d1b093dbf..8bffff4898 100644 --- a/state/batchprocessor.go +++ b/state/batchprocessor.go @@ -429,6 +429,14 @@ func (b *BasicBatchProcessor) commit(ctx context.Context, batch *Batch) error { if b.stateRoot != nil { root.SetBytes(b.stateRoot) batch.Header.Root = root + + // set local exit root + key := new(big.Int).SetUint64(b.State.cfg.L2GlobalExitRootManagerPosition) + localExitRoot, err := b.State.tree.GetStorageAt(ctx, b.State.cfg.L2GlobalExitRootManagerAddr, common.BigToHash(key), b.stateRoot) + if err != nil { + return err + } + batch.RollupExitRoot = common.BigToHash(localExitRoot) } err := b.State.AddBatch(ctx, batch) diff --git a/state/config.go b/state/config.go index f01958631e..6856004829 100644 --- a/state/config.go +++ b/state/config.go @@ -1,9 +1,15 @@ package state +import "github.com/ethereum/go-ethereum/common" + // Config is state config type Config struct { // DefaultChainID is the common ChainID to all the sequencers DefaultChainID uint64 // MaxCumulativeGasUsed is the max gas allowed per batch MaxCumulativeGasUsed uint64 + // L2GlobalExitRootManagerAddr is the L2 address of the exit root manager SC + L2GlobalExitRootManagerAddr common.Address + // L2GlobalExitRootManagerPosition is the position inside SC's storage to read the new local state root + L2GlobalExitRootManagerPosition uint64 } diff --git a/state/pgstatestorage/pgstatestorage.go b/state/pgstatestorage/pgstatestorage.go index b8453a35e4..0336019020 100644 --- a/state/pgstatestorage/pgstatestorage.go +++ b/state/pgstatestorage/pgstatestorage.go @@ -28,12 +28,12 @@ const ( getBlockByHashSQL = "SELECT * FROM state.block WHERE block_hash = $1" getBlockByNumberSQL = "SELECT * FROM state.block WHERE block_num = $1" getLastBlockNumberSQL = "SELECT COALESCE(MAX(block_num), 0) FROM state.block" - getLastVirtualBatchSQL = "SELECT block_num, sequencer, aggregator, consolidated_tx_hash, header, uncles, raw_txs_data, matic_collateral, received_at, consolidated_at, chain_id, global_exit_root FROM state.batch ORDER BY batch_num DESC LIMIT 1" - getLastConsolidatedBatchSQL = "SELECT block_num, sequencer, aggregator, consolidated_tx_hash, header, uncles, raw_txs_data, matic_collateral, received_at, consolidated_at, chain_id, global_exit_root FROM state.batch WHERE consolidated_tx_hash != $1 ORDER BY batch_num DESC LIMIT 1" - getPreviousVirtualBatchSQL = "SELECT block_num, sequencer, aggregator, consolidated_tx_hash, header, uncles, raw_txs_data, matic_collateral, received_at, consolidated_at, chain_id, global_exit_root FROM state.batch ORDER BY batch_num DESC LIMIT 1 OFFSET $1" - getPreviousConsolidatedBatchSQL = "SELECT block_num, sequencer, aggregator, consolidated_tx_hash, header, uncles, raw_txs_data, matic_collateral, received_at, consolidated_at, chain_id, global_exit_root FROM state.batch WHERE consolidated_tx_hash != $1 ORDER BY batch_num DESC LIMIT 1 OFFSET $2" - getBatchByHashSQL = "SELECT block_num, sequencer, aggregator, consolidated_tx_hash, header, uncles, raw_txs_data, matic_collateral, received_at, consolidated_at, chain_id, global_exit_root FROM state.batch WHERE batch_hash = $1" - getBatchByNumberSQL = "SELECT block_num, sequencer, aggregator, consolidated_tx_hash, header, uncles, raw_txs_data, matic_collateral, received_at, consolidated_at, chain_id, global_exit_root FROM state.batch WHERE batch_num = $1" + getLastVirtualBatchSQL = "SELECT block_num, sequencer, aggregator, consolidated_tx_hash, header, uncles, raw_txs_data, matic_collateral, received_at, consolidated_at, chain_id, global_exit_root, rollup_exit_root FROM state.batch ORDER BY batch_num DESC LIMIT 1" + getLastConsolidatedBatchSQL = "SELECT block_num, sequencer, aggregator, consolidated_tx_hash, header, uncles, raw_txs_data, matic_collateral, received_at, consolidated_at, chain_id, global_exit_root, rollup_exit_root FROM state.batch WHERE consolidated_tx_hash != $1 ORDER BY batch_num DESC LIMIT 1" + getPreviousVirtualBatchSQL = "SELECT block_num, sequencer, aggregator, consolidated_tx_hash, header, uncles, raw_txs_data, matic_collateral, received_at, consolidated_at, chain_id, global_exit_root, rollup_exit_root FROM state.batch ORDER BY batch_num DESC LIMIT 1 OFFSET $1" + getPreviousConsolidatedBatchSQL = "SELECT block_num, sequencer, aggregator, consolidated_tx_hash, header, uncles, raw_txs_data, matic_collateral, received_at, consolidated_at, chain_id, global_exit_root, rollup_exit_root FROM state.batch WHERE consolidated_tx_hash != $1 ORDER BY batch_num DESC LIMIT 1 OFFSET $2" + getBatchByHashSQL = "SELECT block_num, sequencer, aggregator, consolidated_tx_hash, header, uncles, raw_txs_data, matic_collateral, received_at, consolidated_at, chain_id, global_exit_root, rollup_exit_root FROM state.batch WHERE batch_hash = $1" + getBatchByNumberSQL = "SELECT block_num, sequencer, aggregator, consolidated_tx_hash, header, uncles, raw_txs_data, matic_collateral, received_at, consolidated_at, chain_id, global_exit_root, rollup_exit_root FROM state.batch WHERE batch_num = $1" getLastVirtualBatchNumberSQL = "SELECT COALESCE(MAX(batch_num), 0) FROM state.batch" getLastConsolidatedBatchNumberSQL = "SELECT COALESCE(MAX(batch_num), 0) FROM state.batch WHERE consolidated_tx_hash != $1" getTransactionByHashSQL = "SELECT transaction.encoded FROM state.transaction WHERE hash = $1" @@ -51,7 +51,7 @@ const ( getSequencerSQL = "SELECT * FROM state.sequencer WHERE address = $1" getReceiptSQL = "SELECT * FROM state.receipt WHERE tx_hash = $1" resetSQL = "DELETE FROM state.block WHERE block_num > $1" - addBatchSQL = "INSERT INTO state.batch (batch_num, batch_hash, block_num, sequencer, aggregator, consolidated_tx_hash, header, uncles, raw_txs_data, matic_collateral, received_at, chain_id, global_exit_root) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)" + addBatchSQL = "INSERT INTO state.batch (batch_num, batch_hash, block_num, sequencer, aggregator, consolidated_tx_hash, header, uncles, raw_txs_data, matic_collateral, received_at, chain_id, global_exit_root, rollup_exit_root) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14)" addTransactionSQL = "INSERT INTO state.transaction (hash, from_address, encoded, decoded, batch_num, tx_index) VALUES($1, $2, $3, $4, $5, $6)" addReceiptSQL = "INSERT INTO state.receipt (type, post_state, status, cumulative_gas_used, gas_used, batch_num, batch_hash, tx_hash, tx_index, tx_from, tx_to, contract_address) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)" addLogSQL = "INSERT INTO state.log (log_index, transaction_index, transaction_hash, batch_hash, batch_num, address, data, topic0, topic1, topic2, topic3) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)" @@ -212,12 +212,12 @@ func (s *PostgresStorage) GetLastBatch(ctx context.Context, isVirtual bool) (*st err = s.queryRow(ctx, getLastVirtualBatchSQL).Scan(&batch.BlockNumber, &batch.Sequencer, &batch.Aggregator, &batch.ConsolidatedTxHash, &batch.Header, &batch.Uncles, &batch.RawTxsData, &maticCollateral, - &batch.ReceivedAt, &batch.ConsolidatedAt, &chain, &batch.GlobalExitRoot) + &batch.ReceivedAt, &batch.ConsolidatedAt, &chain, &batch.GlobalExitRoot, &batch.RollupExitRoot) } else { err = s.queryRow(ctx, getLastConsolidatedBatchSQL, common.Hash{}).Scan( &batch.BlockNumber, &batch.Sequencer, &batch.Aggregator, &batch.ConsolidatedTxHash, &batch.Header, &batch.Uncles, &batch.RawTxsData, &maticCollateral, - &batch.ReceivedAt, &batch.ConsolidatedAt, &chain, &batch.GlobalExitRoot) + &batch.ReceivedAt, &batch.ConsolidatedAt, &chain, &batch.GlobalExitRoot, &batch.RollupExitRoot) } batch.ChainID = new(big.Int).SetUint64(chain) @@ -246,12 +246,12 @@ func (s *PostgresStorage) GetPreviousBatch(ctx context.Context, isVirtual bool, err = s.queryRow(ctx, getPreviousVirtualBatchSQL, offset).Scan( &batch.BlockNumber, &batch.Sequencer, &batch.Aggregator, &batch.ConsolidatedTxHash, &batch.Header, &batch.Uncles, &batch.RawTxsData, &maticCollateral, - &batch.ReceivedAt, &batch.ConsolidatedAt, &chain, &batch.GlobalExitRoot) + &batch.ReceivedAt, &batch.ConsolidatedAt, &chain, &batch.GlobalExitRoot, &batch.RollupExitRoot) } else { err = s.queryRow(ctx, getPreviousConsolidatedBatchSQL, common.Hash{}, offset).Scan( &batch.BlockNumber, &batch.Sequencer, &batch.Aggregator, &batch.ConsolidatedTxHash, &batch.Header, &batch.Uncles, &batch.RawTxsData, &maticCollateral, - &batch.ReceivedAt, &batch.ConsolidatedAt, &chain, &batch.GlobalExitRoot) + &batch.ReceivedAt, &batch.ConsolidatedAt, &chain, &batch.GlobalExitRoot, &batch.RollupExitRoot) } batch.ChainID = new(big.Int).SetUint64(chain) @@ -275,7 +275,7 @@ func (s *PostgresStorage) GetBatchByHash(ctx context.Context, hash common.Hash) err := s.queryRow(ctx, getBatchByHashSQL, hash).Scan( &batch.BlockNumber, &batch.Sequencer, &batch.Aggregator, &batch.ConsolidatedTxHash, &batch.Header, &batch.Uncles, &batch.RawTxsData, &maticCollateral, - &batch.ReceivedAt, &batch.ConsolidatedAt, &chain, &batch.GlobalExitRoot) + &batch.ReceivedAt, &batch.ConsolidatedAt, &chain, &batch.GlobalExitRoot, &batch.GlobalExitRoot) if errors.Is(err, pgx.ErrNoRows) { return nil, state.ErrNotFound } else if err != nil { @@ -691,7 +691,7 @@ func (s *PostgresStorage) GetLastBatchNumberConsolidatedOnEthereum(ctx context.C // AddBatch adds a new batch to the State Store func (s *PostgresStorage) AddBatch(ctx context.Context, batch *state.Batch) error { _, err := s.exec(ctx, addBatchSQL, batch.Number().Uint64(), batch.Hash(), batch.BlockNumber, batch.Sequencer, batch.Aggregator, - batch.ConsolidatedTxHash, batch.Header, batch.Uncles, batch.RawTxsData, batch.MaticCollateral.String(), batch.ReceivedAt, batch.ChainID.String(), batch.GlobalExitRoot) + batch.ConsolidatedTxHash, batch.Header, batch.Uncles, batch.RawTxsData, batch.MaticCollateral.String(), batch.ReceivedAt, batch.ChainID.String(), batch.GlobalExitRoot, batch.RollupExitRoot) return err } @@ -761,7 +761,7 @@ func (s *PostgresStorage) getBatchWithoutTxsByNumber(ctx context.Context, batchN err := s.db.QueryRow(ctx, getBatchByNumberSQL, batchNumber).Scan( &batch.BlockNumber, &batch.Sequencer, &batch.Aggregator, &batch.ConsolidatedTxHash, &batch.Header, &batch.Uncles, &batch.RawTxsData, &maticCollateral, - &batch.ReceivedAt, &batch.ConsolidatedAt, &chain, &batch.GlobalExitRoot) + &batch.ReceivedAt, &batch.ConsolidatedAt, &chain, &batch.GlobalExitRoot, &batch.RollupExitRoot) if errors.Is(err, pgx.ErrNoRows) { return nil, state.ErrNotFound } else if err != nil {