From b56c734dc9011c970b2c080d49cf896b05bcc98d Mon Sep 17 00:00:00 2001 From: Tsahi Zidenberg Date: Thu, 6 Jul 2023 18:16:03 -0600 Subject: [PATCH 1/2] update geth, add recordingDb config --- arbnode/execution/block_recorder.go | 4 +-- arbnode/execution/node.go | 3 +- arbnode/node.go | 49 +++++++++++++++-------------- go-ethereum | 2 +- 4 files changed, 31 insertions(+), 27 deletions(-) diff --git a/arbnode/execution/block_recorder.go b/arbnode/execution/block_recorder.go index 79da88821c..dc5daa6f7b 100644 --- a/arbnode/execution/block_recorder.go +++ b/arbnode/execution/block_recorder.go @@ -46,10 +46,10 @@ type RecordResult struct { BatchInfo []validator.BatchInfo } -func NewBlockRecorder(execEngine *ExecutionEngine, ethDb ethdb.Database) *BlockRecorder { +func NewBlockRecorder(config *arbitrum.RecordingDatabaseConfig, execEngine *ExecutionEngine, ethDb ethdb.Database) *BlockRecorder { recorder := &BlockRecorder{ execEngine: execEngine, - recordingDatabase: arbitrum.NewRecordingDatabase(ethDb, execEngine.bc), + recordingDatabase: arbitrum.NewRecordingDatabase(config, ethDb, execEngine.bc), } execEngine.SetRecorder(recorder) return recorder diff --git a/arbnode/execution/node.go b/arbnode/execution/node.go index 8b9cdd7538..7456c1d6a7 100644 --- a/arbnode/execution/node.go +++ b/arbnode/execution/node.go @@ -31,6 +31,7 @@ func CreateExecutionNode( fwTarget string, fwConfig *ForwarderConfig, rpcConfig arbitrum.Config, + recordingDbConfig *arbitrum.RecordingDatabaseConfig, seqConfigFetcher SequencerConfigFetcher, precheckConfigFetcher TxPreCheckerConfigFetcher, ) (*ExecutionNode, error) { @@ -38,7 +39,7 @@ func CreateExecutionNode( if err != nil { return nil, err } - recorder := NewBlockRecorder(execEngine, chainDB) + recorder := NewBlockRecorder(recordingDbConfig, execEngine, chainDB) var txPublisher TransactionPublisher var sequencer *Sequencer seqConfig := seqConfigFetcher() diff --git a/arbnode/node.go b/arbnode/node.go index c559eb6298..bf0b5e2db9 100644 --- a/arbnode/node.go +++ b/arbnode/node.go @@ -307,28 +307,29 @@ func DeployOnL1(ctx context.Context, l1client arbutil.L1Interface, deployAuth *b } type Config struct { - RPC arbitrum.Config `koanf:"rpc"` - Sequencer execution.SequencerConfig `koanf:"sequencer" reload:"hot"` - L1Reader headerreader.Config `koanf:"parent-chain-reader" reload:"hot"` - InboxReader InboxReaderConfig `koanf:"inbox-reader" reload:"hot"` - DelayedSequencer DelayedSequencerConfig `koanf:"delayed-sequencer" reload:"hot"` - BatchPoster BatchPosterConfig `koanf:"batch-poster" reload:"hot"` - MessagePruner MessagePrunerConfig `koanf:"message-pruner" reload:"hot"` - ForwardingTargetImpl string `koanf:"forwarding-target"` - Forwarder execution.ForwarderConfig `koanf:"forwarder"` - TxPreChecker execution.TxPreCheckerConfig `koanf:"tx-pre-checker" reload:"hot"` - BlockValidator staker.BlockValidatorConfig `koanf:"block-validator" reload:"hot"` - Feed broadcastclient.FeedConfig `koanf:"feed" reload:"hot"` - Staker staker.L1ValidatorConfig `koanf:"staker"` - SeqCoordinator SeqCoordinatorConfig `koanf:"seq-coordinator"` - DataAvailability das.DataAvailabilityConfig `koanf:"data-availability"` - SyncMonitor SyncMonitorConfig `koanf:"sync-monitor"` - Dangerous DangerousConfig `koanf:"dangerous"` - Caching execution.CachingConfig `koanf:"caching"` - Archive bool `koanf:"archive"` - TxLookupLimit uint64 `koanf:"tx-lookup-limit"` - TransactionStreamer TransactionStreamerConfig `koanf:"transaction-streamer" reload:"hot"` - Maintenance MaintenanceConfig `koanf:"maintenance" reload:"hot"` + RPC arbitrum.Config `koanf:"rpc"` + Sequencer execution.SequencerConfig `koanf:"sequencer" reload:"hot"` + L1Reader headerreader.Config `koanf:"parent-chain-reader" reload:"hot"` + InboxReader InboxReaderConfig `koanf:"inbox-reader" reload:"hot"` + DelayedSequencer DelayedSequencerConfig `koanf:"delayed-sequencer" reload:"hot"` + BatchPoster BatchPosterConfig `koanf:"batch-poster" reload:"hot"` + MessagePruner MessagePrunerConfig `koanf:"message-pruner" reload:"hot"` + ForwardingTargetImpl string `koanf:"forwarding-target"` + Forwarder execution.ForwarderConfig `koanf:"forwarder"` + TxPreChecker execution.TxPreCheckerConfig `koanf:"tx-pre-checker" reload:"hot"` + BlockValidator staker.BlockValidatorConfig `koanf:"block-validator" reload:"hot"` + RecordingDB arbitrum.RecordingDatabaseConfig `koanf:"recording-database"` + Feed broadcastclient.FeedConfig `koanf:"feed" reload:"hot"` + Staker staker.L1ValidatorConfig `koanf:"staker"` + SeqCoordinator SeqCoordinatorConfig `koanf:"seq-coordinator"` + DataAvailability das.DataAvailabilityConfig `koanf:"data-availability"` + SyncMonitor SyncMonitorConfig `koanf:"sync-monitor"` + Dangerous DangerousConfig `koanf:"dangerous"` + Caching execution.CachingConfig `koanf:"caching"` + Archive bool `koanf:"archive"` + TxLookupLimit uint64 `koanf:"tx-lookup-limit"` + TransactionStreamer TransactionStreamerConfig `koanf:"transaction-streamer" reload:"hot"` + Maintenance MaintenanceConfig `koanf:"maintenance" reload:"hot"` } func (c *Config) Validate() error { @@ -392,6 +393,7 @@ func ConfigAddOptions(prefix string, f *flag.FlagSet, feedInputEnable bool, feed execution.AddOptionsForNodeForwarderConfig(prefix+".forwarder", f) execution.TxPreCheckerConfigAddOptions(prefix+".tx-pre-checker", f) staker.BlockValidatorConfigAddOptions(prefix+".block-validator", f) + arbitrum.RecordingDatabaseConfigAddOptions(prefix+".recording-database", f) broadcastclient.FeedConfigAddOptions(prefix+".feed", f, feedInputEnable, feedOutputEnable) staker.L1ValidatorConfigAddOptions(prefix+".staker", f) SeqCoordinatorConfigAddOptions(prefix+".seq-coordinator", f) @@ -418,6 +420,7 @@ var ConfigDefault = Config{ ForwardingTargetImpl: "", TxPreChecker: execution.DefaultTxPreCheckerConfig, BlockValidator: staker.DefaultBlockValidatorConfig, + RecordingDB: arbitrum.DefaultRecordingDatabaseConfig, Feed: broadcastclient.FeedConfigDefault, Staker: staker.DefaultL1ValidatorConfig, SeqCoordinator: DefaultSeqCoordinatorConfig, @@ -605,7 +608,7 @@ func createNodeImpl( sequencerConfigFetcher := func() *execution.SequencerConfig { return &configFetcher.Get().Sequencer } txprecheckConfigFetcher := func() *execution.TxPreCheckerConfig { return &configFetcher.Get().TxPreChecker } exec, err := execution.CreateExecutionNode(stack, chainDb, l2BlockChain, l1Reader, syncMonitor, - config.ForwardingTarget(), &config.Forwarder, config.RPC, + config.ForwardingTarget(), &config.Forwarder, config.RPC, &config.RecordingDB, sequencerConfigFetcher, txprecheckConfigFetcher) if err != nil { return nil, err diff --git a/go-ethereum b/go-ethereum index 8e6a8ad494..704d1b80c8 160000 --- a/go-ethereum +++ b/go-ethereum @@ -1 +1 @@ -Subproject commit 8e6a8ad4942591011e833e6ebceca6bd668f3db0 +Subproject commit 704d1b80c8ffe2d29d18a07d37f3709425a489cc From 9be039780636c5b4a5978e5ae597241dd3e895fe Mon Sep 17 00:00:00 2001 From: Tsahi Zidenberg Date: Fri, 7 Jul 2023 09:18:17 -0600 Subject: [PATCH 2/2] block_validator bugfix: delete validation entry when done --- staker/block_validator.go | 1 + 1 file changed, 1 insertion(+) diff --git a/staker/block_validator.go b/staker/block_validator.go index a292dbd6f3..a08564f771 100644 --- a/staker/block_validator.go +++ b/staker/block_validator.go @@ -685,6 +685,7 @@ validationsLoop: log.Error("failed writing new validated to database", "pos", pos, "err", err) } atomicStorePos(&v.validatedA, pos+1) + v.validations.Delete(pos) nonBlockingTrigger(v.createNodesChan) nonBlockingTrigger(v.sendRecordChan) validatorMsgCountValidatedGauge.Update(int64(pos + 1))