From 5eb9704138f997a7b76f1ebf18745116f4ed2c68 Mon Sep 17 00:00:00 2001 From: Ganesh Vanahalli Date: Mon, 9 Dec 2024 15:46:36 -0600 Subject: [PATCH 1/4] Allow waiting for a minimum amount of time since parent assertion was created to post a new assertion --- arbnode/node.go | 2 ++ bold | 2 +- staker/bold/bold_staker.go | 7 ++++++- system_tests/bold_challenge_protocol_test.go | 1 + system_tests/bold_new_challenge_test.go | 1 + system_tests/overflow_assertions_test.go | 1 + 6 files changed, 12 insertions(+), 2 deletions(-) diff --git a/arbnode/node.go b/arbnode/node.go index f2e3433ecd..48920cdbdd 100644 --- a/arbnode/node.go +++ b/arbnode/node.go @@ -212,6 +212,7 @@ func ConfigDefaultL1NonSequencerTest() *Config { config.Staker = legacystaker.TestL1ValidatorConfig config.Staker.Enable = false config.BlockValidator.ValidationServerConfigs = []rpcclient.ClientConfig{{URL: ""}} + config.Bold.MinimumGapToParentAssertion = 0 return &config } @@ -230,6 +231,7 @@ func ConfigDefaultL2Test() *Config { config.Staker.Enable = false config.BlockValidator.ValidationServerConfigs = []rpcclient.ClientConfig{{URL: ""}} config.TransactionStreamer = DefaultTransactionStreamerConfig + config.Bold.MinimumGapToParentAssertion = 0 return &config } diff --git a/bold b/bold index d0a87de774..1b1c34c319 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit d0a87de774aecfa97161efd1b0a924d4d5fbcf74 +Subproject commit 1b1c34c31967242a492d29925640ede98d921fca diff --git a/staker/bold/bold_staker.go b/staker/bold/bold_staker.go index 1a8eed80fa..ad0e24e338 100644 --- a/staker/bold/bold_staker.go +++ b/staker/bold/bold_staker.go @@ -57,7 +57,9 @@ type BoldConfig struct { // How often to scan for newly created assertions onchain. AssertionScanningInterval time.Duration `koanf:"assertion-scanning-interval"` // How often to confirm assertions onchain. - AssertionConfirmingInterval time.Duration `koanf:"assertion-confirming-interval"` + AssertionConfirmingInterval time.Duration `koanf:"assertion-confirming-interval"` + // How long to wait since parent assertion was created to post a new assertion + MinimumGapToParentAssertion time.Duration `koanf:"minimum-gap-to-parent-assertion"` API bool `koanf:"api"` APIHost string `koanf:"api-host"` APIPort uint16 `koanf:"api-port"` @@ -98,6 +100,7 @@ var DefaultBoldConfig = BoldConfig{ AssertionPostingInterval: time.Minute * 15, AssertionScanningInterval: time.Minute, AssertionConfirmingInterval: time.Minute, + MinimumGapToParentAssertion: time.Minute, // Correct default? API: false, APIHost: "127.0.0.1", APIPort: 9393, @@ -121,6 +124,7 @@ func BoldConfigAddOptions(prefix string, f *flag.FlagSet) { f.Duration(prefix+".assertion-posting-interval", DefaultBoldConfig.AssertionPostingInterval, "assertion posting interval") f.Duration(prefix+".assertion-scanning-interval", DefaultBoldConfig.AssertionScanningInterval, "scan assertion interval") f.Duration(prefix+".assertion-confirming-interval", DefaultBoldConfig.AssertionConfirmingInterval, "confirm assertion interval") + f.Duration(prefix+".minimum-gap-to-parent-assertion", DefaultBoldConfig.MinimumGapToParentAssertion, "minimum duration to wait since the parent assertion was created to post a new assertion") f.Duration(prefix+".check-staker-switch-interval", DefaultBoldConfig.CheckStakerSwitchInterval, "how often to check if staker can switch to bold") f.Bool(prefix+".api", DefaultBoldConfig.API, "enable api") f.String(prefix+".api-host", DefaultBoldConfig.APIHost, "bold api host") @@ -448,6 +452,7 @@ func newBOLDChallengeManager( challengemanager.StackWithPollingInterval(scanningInterval), challengemanager.StackWithPostingInterval(postingInterval), challengemanager.StackWithConfirmationInterval(confirmingInterval), + challengemanager.StackWithMinimumGapToParentAssertion(config.MinimumGapToParentAssertion), challengemanager.StackWithTrackChallengeParentAssertionHashes(config.TrackChallengeParentAssertionHashes), challengemanager.StackWithHeaderProvider(l1Reader), } diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index 777817bf3e..3677021c00 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -417,6 +417,7 @@ func testChallengeProtocolBOLD(t *testing.T, spawnerOpts ...server_arb.SpawnerOp challengemanager.StackWithMode(modes.MakeMode), challengemanager.StackWithPostingInterval(time.Second * 3), challengemanager.StackWithPollingInterval(time.Second), + challengemanager.StackWithMinimumGapToParentAssertionCreationTime(0), challengemanager.StackWithAverageBlockCreationTime(time.Second), } diff --git a/system_tests/bold_new_challenge_test.go b/system_tests/bold_new_challenge_test.go index ad6e44bc71..eb452ca5d4 100644 --- a/system_tests/bold_new_challenge_test.go +++ b/system_tests/bold_new_challenge_test.go @@ -344,6 +344,7 @@ func startBoldChallengeManager(t *testing.T, ctx context.Context, builder *NodeB challengemanager.StackWithPostingInterval(time.Second * 3), challengemanager.StackWithPollingInterval(time.Second), challengemanager.StackWithAverageBlockCreationTime(time.Second), + challengemanager.StackWithMinimumGapToParentAssertionCreationTime(0), } challengeManager, err := challengemanager.NewChallengeStack( diff --git a/system_tests/overflow_assertions_test.go b/system_tests/overflow_assertions_test.go index c024a43070..848c61e7d3 100644 --- a/system_tests/overflow_assertions_test.go +++ b/system_tests/overflow_assertions_test.go @@ -224,6 +224,7 @@ func TestOverflowAssertions(t *testing.T) { challengemanager.StackWithPostingInterval(time.Second), challengemanager.StackWithPollingInterval(time.Millisecond * 500), challengemanager.StackWithAverageBlockCreationTime(time.Second), + challengemanager.StackWithMinimumGapToParentAssertionCreationTime(0), } manager, err := challengemanager.NewChallengeStack( From 81dcb5a01589dcb58fd009fd622af1aef38f8e1a Mon Sep 17 00:00:00 2001 From: Ganesh Vanahalli Date: Mon, 9 Dec 2024 16:23:57 -0600 Subject: [PATCH 2/4] minor fix --- system_tests/bold_challenge_protocol_test.go | 2 +- system_tests/bold_new_challenge_test.go | 2 +- system_tests/overflow_assertions_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index 3677021c00..83700fc838 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -417,7 +417,7 @@ func testChallengeProtocolBOLD(t *testing.T, spawnerOpts ...server_arb.SpawnerOp challengemanager.StackWithMode(modes.MakeMode), challengemanager.StackWithPostingInterval(time.Second * 3), challengemanager.StackWithPollingInterval(time.Second), - challengemanager.StackWithMinimumGapToParentAssertionCreationTime(0), + challengemanager.StackWithMinimumGapToParentAssertion(0), challengemanager.StackWithAverageBlockCreationTime(time.Second), } diff --git a/system_tests/bold_new_challenge_test.go b/system_tests/bold_new_challenge_test.go index eb452ca5d4..fae4a57deb 100644 --- a/system_tests/bold_new_challenge_test.go +++ b/system_tests/bold_new_challenge_test.go @@ -344,7 +344,7 @@ func startBoldChallengeManager(t *testing.T, ctx context.Context, builder *NodeB challengemanager.StackWithPostingInterval(time.Second * 3), challengemanager.StackWithPollingInterval(time.Second), challengemanager.StackWithAverageBlockCreationTime(time.Second), - challengemanager.StackWithMinimumGapToParentAssertionCreationTime(0), + challengemanager.StackWithMinimumGapToParentAssertion(0), } challengeManager, err := challengemanager.NewChallengeStack( diff --git a/system_tests/overflow_assertions_test.go b/system_tests/overflow_assertions_test.go index 848c61e7d3..eb2bb01470 100644 --- a/system_tests/overflow_assertions_test.go +++ b/system_tests/overflow_assertions_test.go @@ -224,7 +224,7 @@ func TestOverflowAssertions(t *testing.T) { challengemanager.StackWithPostingInterval(time.Second), challengemanager.StackWithPollingInterval(time.Millisecond * 500), challengemanager.StackWithAverageBlockCreationTime(time.Second), - challengemanager.StackWithMinimumGapToParentAssertionCreationTime(0), + challengemanager.StackWithMinimumGapToParentAssertion(0), } manager, err := challengemanager.NewChallengeStack( From 231da30980575693c2c9f6d7be127ac77772cc9d Mon Sep 17 00:00:00 2001 From: Ganesh Vanahalli Date: Tue, 10 Dec 2024 10:52:02 -0600 Subject: [PATCH 3/4] update bold pin --- bold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bold b/bold index 1b1c34c319..81f1b421b2 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 1b1c34c31967242a492d29925640ede98d921fca +Subproject commit 81f1b421b2dbbf96c7a2b427a9458667b07b0b27 From 830a9245293f296cf9bcd16286abeb4c31dd5279 Mon Sep 17 00:00:00 2001 From: Ganesh Vanahalli Date: Fri, 3 Jan 2025 10:00:08 -0600 Subject: [PATCH 4/4] update bold pin to latest commit on main --- bold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bold b/bold index 81f1b421b2..cb6922fb4f 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 81f1b421b2dbbf96c7a2b427a9458667b07b0b27 +Subproject commit cb6922fb4f50d1cdb12af467a18ecee6f1c688a4