Skip to content
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

Make rpc head configurable [DO NOT MERGE] #2339

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion arbnode/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,8 @@
if err != nil {
return nil, fmt.Errorf("could not get challenge manager: %w", err)
}
assertionChain, err := solimpl.NewAssertionChain(ctx, deployInfo.Rollup, chalManager, txOptsValidator, l1client, solimpl.NewDataPosterTransactor(dp))

assertionChain, err := solimpl.NewAssertionChain(ctx, deployInfo.Rollup, chalManager, txOptsValidator, l1client, solimpl.NewDataPosterTransactor(dp), solimpl.WithRpcHeadBlockNumber(rpc.BlockNumber(config.Bold.RpcHeadBlockNumber)))

Check failure on line 609 in arbnode/node.go

View workflow job for this annotation

GitHub Actions / Go Tests (challenge)

undefined: solimpl.WithRpcHeadBlockNumber

Check failure on line 609 in arbnode/node.go

View workflow job for this annotation

GitHub Actions / Go Tests (challenge)

undefined: solimpl.WithRpcHeadBlockNumber

Check failure on line 609 in arbnode/node.go

View workflow job for this annotation

GitHub Actions / Go Tests (challenge)

undefined: solimpl.WithRpcHeadBlockNumber

Check failure on line 609 in arbnode/node.go

View workflow job for this annotation

GitHub Actions / Go Tests (defaults)

undefined: solimpl.WithRpcHeadBlockNumber

Check failure on line 609 in arbnode/node.go

View workflow job for this annotation

GitHub Actions / Go Tests (defaults)

undefined: solimpl.WithRpcHeadBlockNumber

Check failure on line 609 in arbnode/node.go

View workflow job for this annotation

GitHub Actions / Go Tests (defaults)

undefined: solimpl.WithRpcHeadBlockNumber

Check failure on line 609 in arbnode/node.go

View workflow job for this annotation

GitHub Actions / Go Tests (stylus)

undefined: solimpl.WithRpcHeadBlockNumber

Check failure on line 609 in arbnode/node.go

View workflow job for this annotation

GitHub Actions / Go Tests (stylus)

undefined: solimpl.WithRpcHeadBlockNumber

Check failure on line 609 in arbnode/node.go

View workflow job for this annotation

GitHub Actions / Go Tests (stylus)

undefined: solimpl.WithRpcHeadBlockNumber

Check failure on line 609 in arbnode/node.go

View workflow job for this annotation

GitHub Actions / Go Tests (race)

undefined: solimpl.WithRpcHeadBlockNumber

Check failure on line 609 in arbnode/node.go

View workflow job for this annotation

GitHub Actions / Go Tests (race)

undefined: solimpl.WithRpcHeadBlockNumber

Check failure on line 609 in arbnode/node.go

View workflow job for this annotation

GitHub Actions / Go Tests (race)

undefined: solimpl.WithRpcHeadBlockNumber

Check failure on line 609 in arbnode/node.go

View workflow job for this annotation

GitHub Actions / Go Tests (long)

undefined: solimpl.WithRpcHeadBlockNumber

Check failure on line 609 in arbnode/node.go

View workflow job for this annotation

GitHub Actions / Go Tests (long)

undefined: solimpl.WithRpcHeadBlockNumber

Check failure on line 609 in arbnode/node.go

View workflow job for this annotation

GitHub Actions / Go Tests (long)

undefined: solimpl.WithRpcHeadBlockNumber
if err != nil {
return nil, fmt.Errorf("could not create assertion chain: %w", err)
}
Expand Down
3 changes: 3 additions & 0 deletions staker/state_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ type BoldConfig struct {
APIHost string `koanf:"api-host"`
APIPort uint16 `koanf:"api-port"`
APIDBPath string `koanf:"api-db-path"`
RpcHeadBlockNumber int64 `koanf:"rpc-head-block-number"`
}

var DefaultBoldConfig = BoldConfig{
Expand All @@ -77,6 +78,7 @@ var DefaultBoldConfig = BoldConfig{
APIHost: "127.0.0.1",
APIPort: 9393,
APIDBPath: "/tmp/bold-api-db",
RpcHeadBlockNumber: -3, // Finalized block
}

func BoldConfigAddOptions(prefix string, f *flag.FlagSet) {
Expand All @@ -97,6 +99,7 @@ func BoldConfigAddOptions(prefix string, f *flag.FlagSet) {
f.String(prefix+".api-host", DefaultBoldConfig.APIHost, "bold api host")
f.Uint16(prefix+".api-port", DefaultBoldConfig.APIPort, "bold api port")
f.String(prefix+".api-db-path", DefaultBoldConfig.APIDBPath, "bold api db path")
f.Int64(prefix+".rpc-head-block-number", DefaultBoldConfig.RpcHeadBlockNumber, "head block number (safe(-4), final(-3), latest(-2)) to use for RPC calls")
}

func (c *BoldConfig) Validate() error {
Expand Down
Loading