Skip to content

Commit

Permalink
da: graceful deprecated fallback flag
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxcanfly committed Jun 21, 2024
1 parent ec1edf3 commit 22d5f83
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
7 changes: 5 additions & 2 deletions op-celestia/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,13 @@ func CLIFlags(envPrefix string) []cli.Flag {
},
&cli.BoolFlag{
Name: EthFallbackDisabledFlagName,
Usage: "disable eth fallback",
Usage: "disable eth fallback (deprecated, use FallbackModeFlag instead)",
EnvVars: opservice.PrefixEnvVar(envPrefix, "DA_ETH_FALLBACK_DISABLED"),
Action: func(c *cli.Context, e bool) error {
return fmt.Errorf("this flag is deprecated, use the %s flag and it to %s instead", FallbackModeFlagName, FallbackModeDisabled)
if e {
return c.Set(FallbackModeFlagName, FallbackModeDisabled)
}
return nil
},
},
&cli.StringFlag{
Expand Down
11 changes: 7 additions & 4 deletions op-node/rollup/driver/da.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ import (
)

func SetDAClient(cfg celestia.CLIConfig) error {
// NOTE: for reading from the DA, the fallback mode doesn't matter
// because we always read using blob_data_source.go which is
// the most permissive mode.
client, err := celestia.NewDAClient(cfg.Rpc, cfg.AuthToken, cfg.Namespace, celestia.FallbackModeBlobData)
// NOTE: for reading from the DA, we always read using blob_data_source.go
// Based on the calldata prefix, it may either read from the DA or from the L1 chain.
// In addition, it always reads from the DA for blobs.
// See dataAndHashesFromTxs and DataFromEVMTransactions
// The read path is independent of the fallback mode.
// Therefore the configuration value for FallbackModeBlobData passed here does not matter.
client, err := celestia.NewDAClient(cfg.Rpc, cfg.AuthToken, cfg.Namespace, cfg.FallbackMode)
if err != nil {
return err
}
Expand Down

0 comments on commit 22d5f83

Please sign in to comment.