Skip to content

Commit

Permalink
feat: pass sync service gas limit via cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
gakonst committed Jun 14, 2021
1 parent d109852 commit 787f2ce
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions l2geth/eth/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
5 changes: 3 additions & 2 deletions l2geth/rollup/sync_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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())

Expand Down
1 change: 1 addition & 0 deletions l2geth/rollup/sync_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 787f2ce

Please sign in to comment.