diff --git a/go/enclave/enclave.go b/go/enclave/enclave.go index 092f80f24f..2b383ca8d8 100644 --- a/go/enclave/enclave.go +++ b/go/enclave/enclave.go @@ -972,8 +972,13 @@ func (e *enclaveImpl) Stop() common.SystemError { e.registry.UnsubscribeFromBatches() } + err := e.service.Close() + if err != nil { + e.logger.Error("Could not stop node service", log.ErrKey, err) + } + time.Sleep(time.Second) - err := e.storage.Close() + err = e.storage.Close() if err != nil { e.logger.Error("Could not stop db", log.ErrKey, err) return err diff --git a/go/enclave/evm/ethchainadapter/eth_chainadapter.go b/go/enclave/evm/ethchainadapter/eth_chainadapter.go index 436132e3f9..869a5ac7a3 100644 --- a/go/enclave/evm/ethchainadapter/eth_chainadapter.go +++ b/go/enclave/evm/ethchainadapter/eth_chainadapter.go @@ -136,13 +136,13 @@ func NewLegacyPoolConfig() legacypool.Config { NoLocals: false, Journal: "", Rejournal: 0, - PriceLimit: 0, - PriceBump: 0, - AccountSlots: 100, - GlobalSlots: 10000000, - AccountQueue: 100, - GlobalQueue: 10000000, - Lifetime: 0, + PriceLimit: legacypool.DefaultConfig.PriceLimit, + PriceBump: legacypool.DefaultConfig.PriceBump, + AccountSlots: legacypool.DefaultConfig.AccountSlots, + GlobalSlots: legacypool.DefaultConfig.GlobalSlots, + AccountQueue: legacypool.DefaultConfig.AccountQueue, + GlobalQueue: legacypool.DefaultConfig.GlobalQueue, + Lifetime: legacypool.DefaultConfig.Lifetime, } } diff --git a/go/enclave/nodetype/interfaces.go b/go/enclave/nodetype/interfaces.go index d4befbf498..f6d0ec051c 100644 --- a/go/enclave/nodetype/interfaces.go +++ b/go/enclave/nodetype/interfaces.go @@ -20,6 +20,8 @@ type NodeType interface { // OnL1Block - performed after the block was processed OnL1Block(block types.Block, result *components.BlockIngestionType) error + + Close() error } type Sequencer interface { diff --git a/go/enclave/nodetype/sequencer.go b/go/enclave/nodetype/sequencer.go index c8dd9dc6a0..d8a39bf1a7 100644 --- a/go/enclave/nodetype/sequencer.go +++ b/go/enclave/nodetype/sequencer.go @@ -449,3 +449,7 @@ func (s *sequencer) OnL1Block(_ types.Block, _ *components.BlockIngestionType) e // nothing to do return nil } + +func (s *sequencer) Close() error { + return s.mempool.Close() +} diff --git a/go/enclave/nodetype/validator.go b/go/enclave/nodetype/validator.go index 28663e7d72..fae31d6df6 100644 --- a/go/enclave/nodetype/validator.go +++ b/go/enclave/nodetype/validator.go @@ -153,3 +153,7 @@ func (val *obsValidator) handleGenesis(batch *core.Batch) error { func (val *obsValidator) OnL1Block(_ types.Block, _ *components.BlockIngestionType) error { return val.ExecuteStoredBatches() } + +func (val *obsValidator) Close() error { + return nil +} diff --git a/go/enclave/txpool/txpool.go b/go/enclave/txpool/txpool.go index 22cb7b245b..63bfb45d5c 100644 --- a/go/enclave/txpool/txpool.go +++ b/go/enclave/txpool/txpool.go @@ -75,3 +75,7 @@ func (t *TxPool) Add(transaction *common.L2Tx) error { func (t *TxPool) Running() bool { return t.running } + +func (t *TxPool) Close() error { + return t.legacyPool.Close() +}