Skip to content

Commit

Permalink
Added flag for disabling signing.
Browse files Browse the repository at this point in the history
Signed-off-by: Cody Littley <[email protected]>
  • Loading branch information
cody-littley committed Dec 19, 2024
1 parent c83db79 commit e5cb69c
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 38 deletions.
26 changes: 14 additions & 12 deletions disperser/cmd/controller/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ type Config struct {

DynamoDBTableName string

EthClientConfig geth.EthClientConfig
AwsClientConfig aws.ClientConfig
DisperserKMSKeyID string
LoggerConfig common.LoggerConfig
IndexerConfig indexer.Config
ChainStateConfig thegraph.Config
UseGraph bool
EthClientConfig geth.EthClientConfig
AwsClientConfig aws.ClientConfig
DisperserStoreChunksSigningDisabled bool
DisperserKMSKeyID string
LoggerConfig common.LoggerConfig
IndexerConfig indexer.Config
ChainStateConfig thegraph.Config
UseGraph bool

BLSOperatorStateRetrieverAddr string
EigenDAServiceManagerAddr string
Expand Down Expand Up @@ -61,11 +62,12 @@ func NewConfig(ctx *cli.Context) (Config, error) {
relays[i] = corev2.RelayKey(relay)
}
config := Config{
DynamoDBTableName: ctx.GlobalString(flags.DynamoDBTableNameFlag.Name),
EthClientConfig: ethClientConfig,
AwsClientConfig: aws.ReadClientConfig(ctx, flags.FlagPrefix),
DisperserKMSKeyID: ctx.GlobalString(flags.DisperserKMSKeyIDFlag.Name),
LoggerConfig: *loggerConfig,
DynamoDBTableName: ctx.GlobalString(flags.DynamoDBTableNameFlag.Name),
EthClientConfig: ethClientConfig,
AwsClientConfig: aws.ReadClientConfig(ctx, flags.FlagPrefix),
DisperserStoreChunksSigningDisabled: ctx.GlobalBool(flags.DisperserStoreChunksSigningDisabledFlag.Name),
DisperserKMSKeyID: ctx.GlobalString(flags.DisperserKMSKeyIDFlag.Name),
LoggerConfig: *loggerConfig,
EncodingManagerConfig: controller.EncodingManagerConfig{
PullInterval: ctx.GlobalDuration(flags.EncodingPullIntervalFlag.Name),
EncodingRequestTimeout: ctx.GlobalDuration(flags.EncodingRequestTimeoutFlag.Name),
Expand Down
11 changes: 9 additions & 2 deletions disperser/cmd/controller/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,16 @@ var (
EnvVar: common.PrefixEnvVar(envVarPrefix, "METRICS_PORT"),
Value: 9101,
}
DisperserStoreChunksSigningDisabledFlag = cli.BoolFlag{
Name: common.PrefixFlag(FlagPrefix, "disperser-store-chunks-signing-disabled"),
Usage: "Whether to disable signing of store chunks requests",
Required: false,
EnvVar: common.PrefixEnvVar(envVarPrefix, "DISPERSER_STORE_CHUNKS_SIGNING_DISABLED"),
}
DisperserKMSKeyIDFlag = cli.StringFlag{
Name: common.PrefixFlag(FlagPrefix, "disperser-kms-key-id"),
Usage: "Name of the key used to sign disperser requests (key must be stored in AWS KMS under this name)",
Required: true,
Required: false,
EnvVar: common.PrefixEnvVar(envVarPrefix, "DISPERSER_KMS_KEY_ID"),
}
)
Expand All @@ -198,7 +204,6 @@ var requiredFlags = []cli.Flag{
DispatcherPullIntervalFlag,
NodeRequestTimeoutFlag,
NumConnectionsToNodesFlag,
DisperserKMSKeyIDFlag,
}

var optionalFlags = []cli.Flag{
Expand All @@ -217,6 +222,8 @@ var optionalFlags = []cli.Flag{
NodeClientCacheNumEntriesFlag,
MaxBatchSizeFlag,
MetricsPortFlag,
DisperserStoreChunksSigningDisabledFlag,
DisperserKMSKeyIDFlag,
}

var Flags []cli.Flag
Expand Down
2 changes: 1 addition & 1 deletion disperser/cmd/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func RunController(ctx *cli.Context) error {
}

var requestSigner clients.RequestSigner
if config.DisperserKMSKeyID != "" {
if !config.DisperserStoreChunksSigningDisabled {
requestSigner, err = clients.NewRequestSigner(
context.Background(),
config.AwsClientConfig.Region,
Expand Down
42 changes: 21 additions & 21 deletions inabox/deploy/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,27 +323,27 @@ func (env *Config) generateEncoderV2Vars(ind int, grpcPort string) EncoderVars {

func (env *Config) generateControllerVars(ind int, graphUrl string) ControllerVars {
v := ControllerVars{
CONTROLLER_DYNAMODB_TABLE_NAME: "test-BlobMetadata-v2",
CONTROLLER_BLS_OPERATOR_STATE_RETRIVER: env.EigenDA.OperatorStateRetreiver,
CONTROLLER_EIGENDA_SERVICE_MANAGER: env.EigenDA.ServiceManager,
CONTROLLER_USE_GRAPH: "true",
CONTROLLER_GRAPH_URL: graphUrl,
CONTROLLER_ENCODING_PULL_INTERVAL: "1s",
CONTROLLER_AVAILABLE_RELAYS: "0,1,2,3",
CONTROLLER_DISPATCHER_PULL_INTERVAL: "3s",
CONTROLLER_NODE_REQUEST_TIMEOUT: "5s",
CONTROLLER_NUM_CONNECTIONS_TO_NODES: "10",
CONTROLLER_CHAIN_RPC: "",
CONTROLLER_PRIVATE_KEY: "123",
CONTROLLER_NUM_CONFIRMATIONS: "0",
CONTROLLER_INDEXER_PULL_INTERVAL: "1s",
CONTROLLER_AWS_REGION: "",
CONTROLLER_AWS_ACCESS_KEY_ID: "",
CONTROLLER_AWS_SECRET_ACCESS_KEY: "",
CONTROLLER_AWS_ENDPOINT_URL: "",
CONTROLLER_ENCODER_ADDRESS: "0.0.0.0:34001",
CONTROLLER_FINALIZATION_BLOCK_DELAY: "0",
CONTROLLER_DISPERSER_KMS_KEY_ID: "",
CONTROLLER_DYNAMODB_TABLE_NAME: "test-BlobMetadata-v2",
CONTROLLER_BLS_OPERATOR_STATE_RETRIVER: env.EigenDA.OperatorStateRetreiver,
CONTROLLER_EIGENDA_SERVICE_MANAGER: env.EigenDA.ServiceManager,
CONTROLLER_USE_GRAPH: "true",
CONTROLLER_GRAPH_URL: graphUrl,
CONTROLLER_ENCODING_PULL_INTERVAL: "1s",
CONTROLLER_AVAILABLE_RELAYS: "0,1,2,3",
CONTROLLER_DISPATCHER_PULL_INTERVAL: "3s",
CONTROLLER_NODE_REQUEST_TIMEOUT: "5s",
CONTROLLER_NUM_CONNECTIONS_TO_NODES: "10",
CONTROLLER_CHAIN_RPC: "",
CONTROLLER_PRIVATE_KEY: "123",
CONTROLLER_NUM_CONFIRMATIONS: "0",
CONTROLLER_INDEXER_PULL_INTERVAL: "1s",
CONTROLLER_AWS_REGION: "",
CONTROLLER_AWS_ACCESS_KEY_ID: "",
CONTROLLER_AWS_SECRET_ACCESS_KEY: "",
CONTROLLER_AWS_ENDPOINT_URL: "",
CONTROLLER_ENCODER_ADDRESS: "0.0.0.0:34001",
CONTROLLER_FINALIZATION_BLOCK_DELAY: "0",
CONTROLLER_DISPERSER_STORE_CHUNKS_SIGNING_DISABLED: "true",
}
env.applyDefaults(&v, "CONTROLLER", "controller", ind)

Expand Down
6 changes: 4 additions & 2 deletions inabox/deploy/env_vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,6 @@ type ControllerVars struct {

CONTROLLER_NUM_CONNECTIONS_TO_NODES string

CONTROLLER_DISPERSER_KMS_KEY_ID string

CONTROLLER_INDEXER_DATA_DIR string

CONTROLLER_ENCODING_REQUEST_TIMEOUT string
Expand Down Expand Up @@ -655,6 +653,10 @@ type ControllerVars struct {

CONTROLLER_METRICS_PORT string

CONTROLLER_DISPERSER_STORE_CHUNKS_SIGNING_DISABLED string

CONTROLLER_DISPERSER_KMS_KEY_ID string

CONTROLLER_CHAIN_RPC string

CONTROLLER_CHAIN_RPC_FALLBACK string
Expand Down

0 comments on commit e5cb69c

Please sign in to comment.