Skip to content

Commit 219a105

Browse files
committed
fix: ensure context is created with middleware addresses
1 parent 03618d9 commit 219a105

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

pkg/commands/context/context_create.go

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,24 @@ func contextCreateAction(cCtx *cli.Context) error {
196196
logger.Info("Continuing with addresses from config...")
197197
} else {
198198
logger.Info("Successfully updated context with addresses from Zeus")
199-
if err := common.WriteYAML(yamlPath, rootNode); err != nil {
200-
return fmt.Errorf("failed to save updated context: %v", err)
201-
}
202199
}
203200
}
204201

202+
// Place middleware addresses into context
203+
bn254TableCalculator := common.SEPOLIA_BN254_TABLE_CALCULATOR_ADDRESS
204+
ecdsaTableCalculator := common.SEPOLIA_ECDSA_TABLE_CALCULATOR_ADDRESS
205+
if int(l1ChainID.Uint64()) == 1 {
206+
bn254TableCalculator = common.MAINNET_BN254_TABLE_CALCULATOR_ADDRESS
207+
ecdsaTableCalculator = common.MAINNET_ECDSA_TABLE_CALCULATOR_ADDRESS
208+
}
209+
common.WriteToPath(contextNode, strings.Split("eigenlayer.l1.bn254_table_calculator", "."), bn254TableCalculator)
210+
common.WriteToPath(contextNode, strings.Split("eigenlayer.l1.ecdsa_table_calculator", "."), ecdsaTableCalculator)
211+
212+
// Save all updates to the yaml file
213+
if err := common.WriteYAML(yamlPath, rootNode); err != nil {
214+
return fmt.Errorf("failed to save updated context: %v", err)
215+
}
216+
205217
logContextCreated(logger, cntxDir, name, ctxDoc, cCtx.Bool("use"))
206218
return nil
207219
}

0 commit comments

Comments
 (0)