Skip to content

Commit

Permalink
op-node: add more comments, fix flag description
Browse files Browse the repository at this point in the history
  • Loading branch information
protolambda committed Sep 5, 2024
1 parent 509477d commit d9c22e4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
5 changes: 3 additions & 2 deletions op-node/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ var (
Category: RollupCategory,
}
SupervisorAddr = &cli.StringFlag{
Name: "supervisor",
Usage: "Experimental feature. Do not use. Address of interop supervisor service for cross-chain safety verification.",
Name: "supervisor",
Usage: "RPC address of interop supervisor service for cross-chain safety verification." +
"Applies only to Interop-enabled networks.",
Hidden: true, // hidden for now during early testing.
EnvVars: prefixEnvVars("SUPERVISOR"),
}
Expand Down
2 changes: 1 addition & 1 deletion op-node/node/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (cfg *Config) Check() error {
return fmt.Errorf("the Interop upgrade is scheduled (timestamp = %d) but no supervisor RPC endpoint is configured", *cfg.Rollup.InteropTime)
}
if err := cfg.Supervisor.Check(); err != nil {
return fmt.Errorf("misconfigured supervsiro RPC endpoint: %w", err)
return fmt.Errorf("misconfigured supervisor RPC endpoint: %w", err)
}
}
if err := cfg.Rollup.Check(); err != nil {
Expand Down
3 changes: 3 additions & 0 deletions op-node/rollup/driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ func NewDriver(

opts := event.DefaultRegisterOpts()

// If interop is scheduled we start the driver.
// It will then be ready to pick up verification work
// as soon as we reach the upgrade time (if the upgrade is not already active).
if cfg.InteropTime != nil {
interopDeriver := interop.NewInteropDeriver(log, cfg, driverCtx, supervisor, l2)
sys.Register("interop", interopDeriver, opts)
Expand Down
6 changes: 4 additions & 2 deletions op-node/rollup/interop/interop.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ func (d *InteropDeriver) OnEvent(ev event.Event) bool {
if x.CrossUnsafe.Number >= x.LocalUnsafe.Number {
break // nothing left to promote
}
// pre-interop the engine itself handles promotion to cross-unsafe
// Pre-interop the engine itself handles promotion to cross-unsafe.
// Check if the next block (still unsafe) can be promoted to cross-unsafe.
if !d.cfg.IsInterop(d.cfg.TimestampForBlock(x.CrossUnsafe.Number + 1)) {
return false
}
Expand Down Expand Up @@ -112,7 +113,8 @@ func (d *InteropDeriver) OnEvent(ev event.Event) bool {
if x.CrossSafe.Number >= x.LocalSafe.Number {
break // nothing left to promote
}
// pre-interop the engine itself handles promotion to cross-safe
// Pre-interop the engine itself handles promotion to cross-safe.
// Check if the next block (not yet cross-safe) can be promoted to cross-safe.
if !d.cfg.IsInterop(d.cfg.TimestampForBlock(x.CrossSafe.Number + 1)) {
return false
}
Expand Down

0 comments on commit d9c22e4

Please sign in to comment.