Skip to content

Commit

Permalink
Merge pull request #2956 from OffchainLabs/fix_block
Browse files Browse the repository at this point in the history
Make get_logs call in small chunks - backport
  • Loading branch information
tsahee authored Feb 13, 2025
2 parents 33d30c0 + 7c39928 commit 13b9b8b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bold
4 changes: 4 additions & 0 deletions staker/bold/bold_staker.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ type BoldConfig struct {
APIDBPath string `koanf:"api-db-path"`
TrackChallengeParentAssertionHashes []string `koanf:"track-challenge-parent-assertion-hashes"`
CheckStakerSwitchInterval time.Duration `koanf:"check-staker-switch-interval"`
MaxGetLogBlocks int64 `koanf:"max-get-log-blocks"`
StateProviderConfig StateProviderConfig `koanf:"state-provider-config"`
StartValidationFromStaked bool `koanf:"start-validation-from-staked"`
AutoDeposit bool `koanf:"auto-deposit"`
Expand Down Expand Up @@ -141,6 +142,7 @@ var DefaultBoldConfig = BoldConfig{
AutoIncreaseAllowance: true,
DelegatedStaking: DefaultDelegatedStakingConfig,
RPCBlockNumber: "finalized",
MaxGetLogBlocks: 5000,
}

var BoldModes = map[legacystaker.StakerStrategy]boldtypes.Mode{
Expand All @@ -154,6 +156,7 @@ func BoldConfigAddOptions(prefix string, f *flag.FlagSet) {
f.Bool(prefix+".enable", DefaultBoldConfig.Enable, "enable bold challenge protocol")
f.String(prefix+".strategy", DefaultBoldConfig.Strategy, "define the bold validator staker strategy, either watchtower, defensive, stakeLatest, or makeNodes")
f.String(prefix+".rpc-block-number", DefaultBoldConfig.RPCBlockNumber, "define the block number to use for reading data onchain, either latest, safe, or finalized")
f.Int64(prefix+".max-get-log-blocks", DefaultBoldConfig.MaxGetLogBlocks, "maximum size for chunk of blocks when using get logs rpc")
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")
Expand Down Expand Up @@ -521,6 +524,7 @@ func newBOLDChallengeManager(
challengemanager.StackWithMinimumGapToParentAssertion(config.MinimumGapToParentAssertion),
challengemanager.StackWithTrackChallengeParentAssertionHashes(config.TrackChallengeParentAssertionHashes),
challengemanager.StackWithHeaderProvider(l1Reader),
challengemanager.StackWithSyncMaxGetLogBlocks(config.MaxGetLogBlocks),
}
if config.API {
apiAddr := fmt.Sprintf("%s:%d", config.APIHost, config.APIPort)
Expand Down

0 comments on commit 13b9b8b

Please sign in to comment.