refactor: extract chain-state coordinator into provider-coordinator (2) - #336
Open
danielbui12 wants to merge 5 commits into
Open
refactor: extract chain-state coordinator into provider-coordinator (2)#336danielbui12 wants to merge 5 commits into
danielbui12 wants to merge 5 commits into
Conversation
- Read `Providers` and `ProviderReplayStates` through typed static storage addresses, mapping the runtime `ProviderInfo` into the crate's flattened one - Read the `RequestTimeout` constant through its generated address, probing metadata first so an absent constant still reports as absent, not as a decode failure - Fetch the anchor block via the generated `StorageProviderApi` payload instead of `call_raw` plus a hand-written `u32::decode` - Decode the six provider-lifecycle events through the generated event structs, matching the approach already used in `provider-chain` - Drop the scale_value walkers this replaces and move `codec` to dev-dependencies - All 13 `ProviderInfo` fields now fail loudly on a shape mismatch; `multiaddr`, `replica_sync_price`, `deregister_at` and the two stats counters previously fell back to defaults without an error
…provider_coordinator_with_subxt
…ordinator` - Drop `unvalidated()` from the `Providers` and `ProviderReplayStates` reads, the `RequestTimeout` constant, and the anchor-block runtime API call, so each address is hash-checked against the runtime metadata the node serves - Replace the hand-rolled metadata probe in `fetch_request_timeout` with a match on subxt's own `ConstantNameNotFound` / `PalletNameNotFound`; validation raises those directly, so the absent-constant case no longer needs its own lookup and still reports as `Ok(None)` - Runtime drift now fails at fetch time rather than surfacing later as a decode error; the coordinator tests confirm the paseo-generated hashes match the local runtime
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes
storage-subxtinprovider-coordinatorstorage-subxt