Skip to content

Commit

Permalink
close mempool and use the geth defaults for the mempool
Browse files Browse the repository at this point in the history
  • Loading branch information
tudor-malene committed Dec 14, 2023
1 parent 7c2a4df commit db89f31
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 8 deletions.
7 changes: 6 additions & 1 deletion go/enclave/enclave.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions go/enclave/evm/ethchainadapter/eth_chainadapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand Down
2 changes: 2 additions & 0 deletions go/enclave/nodetype/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions go/enclave/nodetype/sequencer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
4 changes: 4 additions & 0 deletions go/enclave/nodetype/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
4 changes: 4 additions & 0 deletions go/enclave/txpool/txpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

0 comments on commit db89f31

Please sign in to comment.