From fd638c1a37e24ca70f1c61b481a7aa5f2c2a1466 Mon Sep 17 00:00:00 2001 From: jcstein <46639943+jcstein@users.noreply.github.com> Date: Tue, 27 Aug 2024 15:42:36 -0400 Subject: [PATCH 1/4] feat: add DAKeyringKeyname flag --- cmd/rollkit/commands/run_node_test.go | 2 ++ cmd/rollkit/docs/rollkit_start.md | 1 + config/config.go | 5 +++++ da/da.md | 1 + 4 files changed, 9 insertions(+) diff --git a/cmd/rollkit/commands/run_node_test.go b/cmd/rollkit/commands/run_node_test.go index 6d7464276d..9ac5d772d9 100644 --- a/cmd/rollkit/commands/run_node_test.go +++ b/cmd/rollkit/commands/run_node_test.go @@ -33,6 +33,7 @@ func TestParseFlags(t *testing.T) { "--rollkit.da_mempool_ttl", "10", "--rollkit.da_namespace", "namespace", "--rollkit.da_start_height", "100", + "--rollkit.da_keyring_keyname", "my_celes_key", "--rollkit.lazy_aggregator", "--rollkit.lazy_block_time", "2m", "--rollkit.light", @@ -84,6 +85,7 @@ func TestParseFlags(t *testing.T) { {"DAMempoolTTL", nodeConfig.DAMempoolTTL, uint64(10)}, {"DANamespace", nodeConfig.DANamespace, "namespace"}, {"DAStartHeight", nodeConfig.DAStartHeight, uint64(100)}, + {"DAKeyringKeyname", nodeConfig.DAKeyringKeyname, "my_celes_key"}, {"LazyAggregator", nodeConfig.LazyAggregator, true}, {"LazyBlockTime", nodeConfig.LazyBlockTime, 2 * time.Minute}, {"Light", nodeConfig.Light, true}, diff --git a/cmd/rollkit/docs/rollkit_start.md b/cmd/rollkit/docs/rollkit_start.md index e6473aa899..bc8ca468a7 100644 --- a/cmd/rollkit/docs/rollkit_start.md +++ b/cmd/rollkit/docs/rollkit_start.md @@ -39,6 +39,7 @@ rollkit start [flags] --rollkit.da_mempool_ttl uint number of DA blocks until transaction is dropped from the mempool --rollkit.da_namespace string DA namespace to submit blob transactions --rollkit.da_start_height uint starting DA block height (for syncing) + --rollkit.da_keyring_keyname string DA keyring.keyname for blobs submissions --rollkit.lazy_aggregator wait for transactions, don't build empty blocks --rollkit.lazy_block_time duration block time (for lazy mode) (default 1m0s) --rollkit.light run light client diff --git a/config/config.go b/config/config.go index 4fd287554e..2007d2eb75 100644 --- a/config/config.go +++ b/config/config.go @@ -28,6 +28,8 @@ const ( FlagDAStartHeight = "rollkit.da_start_height" // FlagDANamespace is a flag for specifying the DA namespace ID FlagDANamespace = "rollkit.da_namespace" + // FlagDAKeyringKeyname is a flag to specify the key name to use for blobs submission on celestia-node + FlagDAKeyringKeyname = "rollkit.da_keyring_keyname" // FlagLight is a flag for running the node in light mode FlagLight = "rollkit.light" // FlagTrustedHash is a flag for specifying the trusted hash @@ -62,6 +64,7 @@ type NodeConfig struct { // CLI flags DANamespace string `mapstructure:"da_namespace"` + DAKeyringKeyname string `mapstructure:"da_keyring_keyname"` } // HeaderConfig allows node to pass the initial trusted header hash to start the header exchange service @@ -128,6 +131,7 @@ func (nc *NodeConfig) GetViperConfig(v *viper.Viper) error { nc.DANamespace = v.GetString(FlagDANamespace) nc.DAStartHeight = v.GetUint64(FlagDAStartHeight) nc.DABlockTime = v.GetDuration(FlagDABlockTime) + nc.DAKeyringKeyname = v.GetString(FlagDAKeyringKeyname) nc.BlockTime = v.GetDuration(FlagBlockTime) nc.LazyAggregator = v.GetBool(FlagLazyAggregator) nc.Light = v.GetBool(FlagLight) @@ -153,6 +157,7 @@ func AddFlags(cmd *cobra.Command) { cmd.Flags().Float64(FlagDAGasMultiplier, def.DAGasMultiplier, "DA gas price multiplier for retrying blob transactions") cmd.Flags().Uint64(FlagDAStartHeight, def.DAStartHeight, "starting DA block height (for syncing)") cmd.Flags().String(FlagDANamespace, def.DANamespace, "DA namespace to submit blob transactions") + cmd.Flags().String(FlagDAKeyringKeyname, def.DAKeyringKeyname, "DA keyring.keyname to submit blob transactions") cmd.Flags().Bool(FlagLight, def.Light, "run light client") cmd.Flags().String(FlagTrustedHash, def.TrustedHash, "initial trusted hash to start the header exchange service") cmd.Flags().Uint64(FlagMaxPendingBlocks, def.MaxPendingBlocks, "limit of blocks pending DA submission (0 for no limit)") diff --git a/da/da.md b/da/da.md index 9c87cd63f7..6a6c385f62 100644 --- a/da/da.md +++ b/da/da.md @@ -9,6 +9,7 @@ Rollkit provides a wrapper for [go-da][go-da], a generic data availability inter * `--rollkit.da_address`: url address of the DA service (default: "grpc://localhost:26650") * `--rollkit.da_auth_token`: authentication token of the DA service * `--rollkit.da_namespace`: namespace to use when submitting blobs to the DA service +* `--rollkit.da_keyring_keyname`: keyring.keyname used when submitting blobs to the DA service (default: my_celes_key) Given a set of blocks to be submitted to DA by the block manager, the `SubmitBlocks` first encodes the blocks using protobuf (the encoded data are called blobs) and invokes the `Submit` method on the underlying DA implementation. On successful submission (`StatusSuccess`), the DA block height which included in the rollup blocks is returned. From 732a6e8fcb61c1ee66333a0c1d2a6fb76e05b065 Mon Sep 17 00:00:00 2001 From: jcstein <46639943+jcstein@users.noreply.github.com> Date: Tue, 27 Aug 2024 15:59:38 -0400 Subject: [PATCH 2/4] fix: linting --- config/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index 2007d2eb75..5ed10fda76 100644 --- a/config/config.go +++ b/config/config.go @@ -63,7 +63,7 @@ type NodeConfig struct { DAGasMultiplier float64 `mapstructure:"da_gas_multiplier"` // CLI flags - DANamespace string `mapstructure:"da_namespace"` + DANamespace string `mapstructure:"da_namespace"` DAKeyringKeyname string `mapstructure:"da_keyring_keyname"` } From de958951087d28be5da6640353a7b59791b6dbb5 Mon Sep 17 00:00:00 2001 From: jcstein <46639943+jcstein@users.noreply.github.com> Date: Tue, 27 Aug 2024 16:02:24 -0400 Subject: [PATCH 3/4] fix: alphabetize flags --- cmd/rollkit/docs/rollkit_start.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/rollkit/docs/rollkit_start.md b/cmd/rollkit/docs/rollkit_start.md index bc8ca468a7..d702715560 100644 --- a/cmd/rollkit/docs/rollkit_start.md +++ b/cmd/rollkit/docs/rollkit_start.md @@ -36,10 +36,10 @@ rollkit start [flags] --rollkit.da_block_time duration DA chain block time (for syncing) (default 15s) --rollkit.da_gas_multiplier float DA gas price multiplier for retrying blob transactions --rollkit.da_gas_price float DA gas price for blob transactions (default -1) + --rollkit.da_keyring_keyname string DA keyring.keyname to submit blob transactions --rollkit.da_mempool_ttl uint number of DA blocks until transaction is dropped from the mempool --rollkit.da_namespace string DA namespace to submit blob transactions --rollkit.da_start_height uint starting DA block height (for syncing) - --rollkit.da_keyring_keyname string DA keyring.keyname for blobs submissions --rollkit.lazy_aggregator wait for transactions, don't build empty blocks --rollkit.lazy_block_time duration block time (for lazy mode) (default 1m0s) --rollkit.light run light client From 14901ded7fff99921979dd83ae238e68f8777b9d Mon Sep 17 00:00:00 2001 From: jcstein <46639943+jcstein@users.noreply.github.com> Date: Thu, 29 Aug 2024 18:50:11 -0400 Subject: [PATCH 4/4] feat: rename to KeyName --- cmd/rollkit/commands/run_node_test.go | 4 ++-- cmd/rollkit/docs/rollkit_start.md | 2 +- config/config.go | 10 +++++----- da/da.md | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/rollkit/commands/run_node_test.go b/cmd/rollkit/commands/run_node_test.go index 9ac5d772d9..ad252af3ad 100644 --- a/cmd/rollkit/commands/run_node_test.go +++ b/cmd/rollkit/commands/run_node_test.go @@ -33,7 +33,7 @@ func TestParseFlags(t *testing.T) { "--rollkit.da_mempool_ttl", "10", "--rollkit.da_namespace", "namespace", "--rollkit.da_start_height", "100", - "--rollkit.da_keyring_keyname", "my_celes_key", + "--rollkit.da_keyname", "my_celes_key", "--rollkit.lazy_aggregator", "--rollkit.lazy_block_time", "2m", "--rollkit.light", @@ -85,7 +85,7 @@ func TestParseFlags(t *testing.T) { {"DAMempoolTTL", nodeConfig.DAMempoolTTL, uint64(10)}, {"DANamespace", nodeConfig.DANamespace, "namespace"}, {"DAStartHeight", nodeConfig.DAStartHeight, uint64(100)}, - {"DAKeyringKeyname", nodeConfig.DAKeyringKeyname, "my_celes_key"}, + {"DAKeyName", nodeConfig.DAKeyName, "my_celes_key"}, {"LazyAggregator", nodeConfig.LazyAggregator, true}, {"LazyBlockTime", nodeConfig.LazyBlockTime, 2 * time.Minute}, {"Light", nodeConfig.Light, true}, diff --git a/cmd/rollkit/docs/rollkit_start.md b/cmd/rollkit/docs/rollkit_start.md index d702715560..b093cafa64 100644 --- a/cmd/rollkit/docs/rollkit_start.md +++ b/cmd/rollkit/docs/rollkit_start.md @@ -36,7 +36,7 @@ rollkit start [flags] --rollkit.da_block_time duration DA chain block time (for syncing) (default 15s) --rollkit.da_gas_multiplier float DA gas price multiplier for retrying blob transactions --rollkit.da_gas_price float DA gas price for blob transactions (default -1) - --rollkit.da_keyring_keyname string DA keyring.keyname to submit blob transactions + --rollkit.da_keyname string DA keyring keyname to submit blob transactions --rollkit.da_mempool_ttl uint number of DA blocks until transaction is dropped from the mempool --rollkit.da_namespace string DA namespace to submit blob transactions --rollkit.da_start_height uint starting DA block height (for syncing) diff --git a/config/config.go b/config/config.go index 5ed10fda76..142761df76 100644 --- a/config/config.go +++ b/config/config.go @@ -28,8 +28,8 @@ const ( FlagDAStartHeight = "rollkit.da_start_height" // FlagDANamespace is a flag for specifying the DA namespace ID FlagDANamespace = "rollkit.da_namespace" - // FlagDAKeyringKeyname is a flag to specify the key name to use for blobs submission on celestia-node - FlagDAKeyringKeyname = "rollkit.da_keyring_keyname" + // FlagDAKeyName is a flag to specify the key name to use for blobs submission on celestia-node + FlagDAKeyName = "rollkit.da_keyname" // FlagLight is a flag for running the node in light mode FlagLight = "rollkit.light" // FlagTrustedHash is a flag for specifying the trusted hash @@ -64,7 +64,7 @@ type NodeConfig struct { // CLI flags DANamespace string `mapstructure:"da_namespace"` - DAKeyringKeyname string `mapstructure:"da_keyring_keyname"` + DAKeyName string `mapstructure:"da_keyname"` } // HeaderConfig allows node to pass the initial trusted header hash to start the header exchange service @@ -131,7 +131,7 @@ func (nc *NodeConfig) GetViperConfig(v *viper.Viper) error { nc.DANamespace = v.GetString(FlagDANamespace) nc.DAStartHeight = v.GetUint64(FlagDAStartHeight) nc.DABlockTime = v.GetDuration(FlagDABlockTime) - nc.DAKeyringKeyname = v.GetString(FlagDAKeyringKeyname) + nc.DAKeyName = v.GetString(FlagDAKeyName) nc.BlockTime = v.GetDuration(FlagBlockTime) nc.LazyAggregator = v.GetBool(FlagLazyAggregator) nc.Light = v.GetBool(FlagLight) @@ -157,7 +157,7 @@ func AddFlags(cmd *cobra.Command) { cmd.Flags().Float64(FlagDAGasMultiplier, def.DAGasMultiplier, "DA gas price multiplier for retrying blob transactions") cmd.Flags().Uint64(FlagDAStartHeight, def.DAStartHeight, "starting DA block height (for syncing)") cmd.Flags().String(FlagDANamespace, def.DANamespace, "DA namespace to submit blob transactions") - cmd.Flags().String(FlagDAKeyringKeyname, def.DAKeyringKeyname, "DA keyring.keyname to submit blob transactions") + cmd.Flags().String(FlagDAKeyName, def.DAKeyName, "DA keyring keyname to submit blob transactions") cmd.Flags().Bool(FlagLight, def.Light, "run light client") cmd.Flags().String(FlagTrustedHash, def.TrustedHash, "initial trusted hash to start the header exchange service") cmd.Flags().Uint64(FlagMaxPendingBlocks, def.MaxPendingBlocks, "limit of blocks pending DA submission (0 for no limit)") diff --git a/da/da.md b/da/da.md index 6a6c385f62..22797a02cd 100644 --- a/da/da.md +++ b/da/da.md @@ -9,7 +9,7 @@ Rollkit provides a wrapper for [go-da][go-da], a generic data availability inter * `--rollkit.da_address`: url address of the DA service (default: "grpc://localhost:26650") * `--rollkit.da_auth_token`: authentication token of the DA service * `--rollkit.da_namespace`: namespace to use when submitting blobs to the DA service -* `--rollkit.da_keyring_keyname`: keyring.keyname used when submitting blobs to the DA service (default: my_celes_key) +* `--rollkit.da_keyname`: keyring keyname used when submitting blobs to the DA service (default: my_celes_key) Given a set of blocks to be submitted to DA by the block manager, the `SubmitBlocks` first encodes the blocks using protobuf (the encoded data are called blobs) and invokes the `Submit` method on the underlying DA implementation. On successful submission (`StatusSuccess`), the DA block height which included in the rollup blocks is returned.