feat(orchestrator): fetch chain details at startup with retry #887
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request type
What is the current behavior?
Currently, the orchestrator fetches chain configuration (chain_id, fee token addresses) during SNOS job processing. This means:
chain_idstrk_fee_token_address,eth_fee_token_address) must be manually configured via environment variablesResolves: #NA
What is the new behavior?
Chain details fetched once at startup: A new
ChainDetailsstruct is fetched at orchestrator startup with retry logic (5s interval, 5min timeout)chain_idfetched from RPC (starknet_chainId)/feeder_gateway/get_contract_addresses)No more env vars for fee tokens: Fee token addresses are now dynamically fetched from the node, removing the need for
MADARA_ORCHESTRATOR_STRK_NATIVE_FEE_TOKEN_ADDRESSandMADARA_ORCHESTRATOR_ETH_NATIVE_FEE_TOKEN_ADDRESSenvironment variablesFail-fast at startup: If the node is unreachable, the orchestrator fails at startup rather than mid-job processing
Does this introduce a breaking change?
Yes - The following environment variables are no longer used and can be removed:
MADARA_ORCHESTRATOR_STRK_NATIVE_FEE_TOKEN_ADDRESSMADARA_ORCHESTRATOR_ETH_NATIVE_FEE_TOKEN_ADDRESSMigration: Simply remove these environment variables from your configuration. The orchestrator will now fetch these values automatically from the node's feeder gateway.
Other information
Architecture