From 787f2ce14bd559f9ec5258e2bcb33eb9ee721dd7 Mon Sep 17 00:00:00 2001 From: Georgios Konstantopoulos Date: Mon, 14 Jun 2021 10:13:31 +0300 Subject: [PATCH] feat: pass sync service gas limit via cfg --- l2geth/eth/config.go | 1 + l2geth/rollup/sync_service.go | 5 +++-- l2geth/rollup/sync_service_test.go | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/l2geth/eth/config.go b/l2geth/eth/config.go index 33186b0935cc..ded83b56b442 100644 --- a/l2geth/eth/config.go +++ b/l2geth/eth/config.go @@ -83,6 +83,7 @@ var DefaultConfig = Config{ MaxCallDataSize: 127000, DataPrice: big.NewInt(100 * params.GWei), ExecutionPrice: big.NewInt(0), + GasLimit: 12_000_000, }, DiffDbCache: 256, } diff --git a/l2geth/rollup/sync_service.go b/l2geth/rollup/sync_service.go index 463cc7bc5e43..659e20116ad7 100644 --- a/l2geth/rollup/sync_service.go +++ b/l2geth/rollup/sync_service.go @@ -77,6 +77,7 @@ func NewSyncService(ctx context.Context, cfg Config, txpool *core.TxPool, bc *co } else { log.Info("Running in sequencer mode", "sync-backend", cfg.Backend.String()) } + log.Info("Sync service gas limit", "gas-limit", cfg.GasLimit) pollInterval := cfg.PollInterval if pollInterval == 0 { @@ -113,7 +114,7 @@ func NewSyncService(ctx context.Context, cfg Config, txpool *core.TxPool, bc *co pollInterval: pollInterval, timestampRefreshThreshold: timestampRefreshThreshold, backend: cfg.Backend, - gasLimit: 9_000_000, + gasLimit: cfg.GasLimit, gpoAddress: cfg.GasPriceOracleAddress, enableL2GasPolling: cfg.EnableL2GasPolling, enforceFees: cfg.EnforceFees, @@ -710,7 +711,7 @@ func (s *SyncService) applyTransactionToTip(tx *types.Transaction) error { _, err = s.bc.WriteBlockWithState(block, receipts, logs, statedb, false) if err != nil { log.Error("Cannot write state with block", "msg", err) - return err + return err } log.Info("New Block", "index", block.Number().Uint64()-1, "tx", tx.Hash().Hex()) diff --git a/l2geth/rollup/sync_service_test.go b/l2geth/rollup/sync_service_test.go index 86a36e89cd7d..50ebdc790f29 100644 --- a/l2geth/rollup/sync_service_test.go +++ b/l2geth/rollup/sync_service_test.go @@ -712,6 +712,7 @@ func newTestSyncService(isVerifier bool) (*SyncService, chan core.NewTxsEvent, e // The client needs to be mocked with a mockClient RollupClientHttp: "", Backend: BackendL2, + GasLimit: 12_000_000, } service, err := NewSyncService(context.Background(), cfg, txPool, chain, db)