-
Notifications
You must be signed in to change notification settings - Fork 688
Don't broadcast old messages to the feed #3526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 10 commits
d8900f4
9814b5d
32d3a70
9baa2ad
65c6435
21007ed
9b9c14a
8ab2a21
9f1f190
431056a
7422726
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,6 +56,7 @@ import ( | |
| "github.com/offchainlabs/nitro/util/redisutil" | ||
| "github.com/offchainlabs/nitro/util/rpcclient" | ||
| "github.com/offchainlabs/nitro/util/signature" | ||
| "github.com/offchainlabs/nitro/util/testhelpers/env" | ||
| "github.com/offchainlabs/nitro/wsbroadcastserver" | ||
| ) | ||
|
|
||
|
|
@@ -210,6 +211,10 @@ func ConfigDefaultL1NonSequencerTest() *Config { | |
| config.Staker.Enable = false | ||
| config.BlockValidator.ValidationServerConfigs = []rpcclient.ClientConfig{{URL: ""}} | ||
| config.Bold.MinimumGapToParentAssertion = 0 | ||
| // Disable broadcast during sync only for path tests as it causes test timeouts | ||
| if env.GetTestStateScheme() == rawdb.PathScheme { | ||
| config.TransactionStreamer.DisableBroadcastDuringSync = false | ||
| } | ||
|
|
||
| return &config | ||
| } | ||
|
|
@@ -228,6 +233,10 @@ func ConfigDefaultL2Test() *Config { | |
| config.Staker.Enable = false | ||
| config.BlockValidator.ValidationServerConfigs = []rpcclient.ClientConfig{{URL: ""}} | ||
| config.TransactionStreamer = DefaultTransactionStreamerConfig | ||
| // Disable broadcast during sync only for path tests as it causes test timeouts | ||
| if env.GetTestStateScheme() == rawdb.PathScheme { | ||
| config.TransactionStreamer.DisableBroadcastDuringSync = false | ||
| } | ||
| config.Bold.MinimumGapToParentAssertion = 0 | ||
|
|
||
| return &config | ||
|
|
@@ -828,11 +837,12 @@ func getTransactionStreamer( | |
| l2Config *params.ChainConfig, | ||
| exec execution.ExecutionClient, | ||
| broadcastServer *broadcaster.Broadcaster, | ||
| syncMonitor *SyncMonitor, | ||
| configFetcher ConfigFetcher, | ||
| fatalErrChan chan error, | ||
| ) (*TransactionStreamer, error) { | ||
| transactionStreamerConfigFetcher := func() *TransactionStreamerConfig { return &configFetcher.Get().TransactionStreamer } | ||
| txStreamer, err := NewTransactionStreamer(ctx, arbDb, l2Config, exec, broadcastServer, fatalErrChan, transactionStreamerConfigFetcher, &configFetcher.Get().SnapSyncTest) | ||
| txStreamer, err := NewTransactionStreamer(ctx, arbDb, l2Config, exec, broadcastServer, syncMonitor, fatalErrChan, transactionStreamerConfigFetcher, &configFetcher.Get().SnapSyncTest) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SyncMonitor depends on TransactionStreamer today, and this creates a circular dependency between them 😬. This indicates to me that they could be better placed in a single component. I created this linear task in order to move logic from SyncMonitor to ConsensusExecutionSyncer, but it is OK to move it TransactionStreamer 🙂.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made a PR to remove the circular dependency: #3538. If you like the approach then I'll rebase this PR ono that.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am re-reading your comment now and I think I got a bit carried away when I saw NIT-3649 and the work I did on #3538 isn't really related to the circular dependency you're talking about here, rather it's related to breaking the consensus<->execution circular dependency. I've spent some time thinking about how to break the circular dependency between TransactionStreamer and arbnode.SyncMonitor, and TransactionStreamer and BroadcastSyncChecker and I can't see a good way to do it without moving all the logic into TransactionStreamer, which I don't really like because SyncMonitor already has a fairly clear responsibility. I am thinking about alternatives now...
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I addressed this in 65c6435 |
||
| if err != nil { | ||
| return nil, err | ||
| } | ||
|
|
@@ -1083,7 +1093,7 @@ func createNodeImpl( | |
| return nil, err | ||
| } | ||
|
|
||
| txStreamer, err := getTransactionStreamer(ctx, arbDb, l2Config, executionClient, broadcastServer, configFetcher, fatalErrChan) | ||
| txStreamer, err := getTransactionStreamer(ctx, arbDb, l2Config, executionClient, broadcastServer, syncMonitor, configFetcher, fatalErrChan) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
|
|
@@ -1460,9 +1470,9 @@ func (n *Node) Start(ctx context.Context) error { | |
| if n.configFetcher != nil { | ||
| n.configFetcher.Start(ctx) | ||
| } | ||
| // Also make sure to call initialize on the sync monitor after the inbox reader, tx streamer, and block validator are started. | ||
| // Else sync might call inbox reader or tx streamer before they are started, and it will lead to panic. | ||
| n.SyncMonitor.Initialize(n.InboxReader, n.TxStreamer, n.SeqCoordinator) | ||
| // Also make sure to call initialize on the sync monitor after the inbox reader, and block validator are started. | ||
| // Else sync might call inbox reader before it is started, and it will lead to panic. | ||
| n.SyncMonitor.Initialize(n.InboxReader, n.SeqCoordinator) | ||
| n.SyncMonitor.Start(ctx) | ||
| if n.ConsensusExecutionSyncer != nil { | ||
| n.ConsensusExecutionSyncer.Start(ctx) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does that happen?
Also it is possible for a test to use pathdb even if env.GetTestStateScheme() != rawdb.PathScheme.
see builder.RequireScheme
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: remove this check, get tests working with Pathdb too. Even with the pathdb tests excluded there appear to be other failures, feed on test startup issues most likely.