Repository navigation
shim: refactor the sugondat rpc client - #76
Merged
Merged
Conversation
Contributor
Author
|
Current dependencies on/for this PR: This stack of pull requests is managed by Graphite. |
pepyakin
force-pushed
the
pep-get-block-fix
branch
from
November 30, 2023 17:15
fe70b97 to
c3d51bb
Compare
This changeset makes a couple of fixes and changes: 1. Now the client strives to provide a peristent connection. See #68. 1. Fix the greedy polling (See #37). Now, only a single task polls for the finalized header. 1. Extracts the timestamp from the extrinsics instead of getting it from the storage. 1. Also sprinkles more documentation, clarifies some assumptions. 1. Now checks whether the subxt codegen matches the runtime metadata. If not, then we assume that the node is still useable, but still warn the user. 1. If the RPC node is not available, instead of bailing out, we keep reconnecting. I imagine this should be useful in cases where we spin up a local network and the shim started up before the sugondat node (plausible IMO). Closes #68 Closes #56 Closes #37
pepyakin
force-pushed
the
pep-get-block-fix
branch
from
November 30, 2023 17:19
c3d51bb to
f593316
Compare
rphmeier
reviewed
Nov 30, 2023
| let subxt = sugondat_subxt::Client::from_rpc_client(raw.clone()).await?; | ||
| check_if_compatible(&subxt)?; | ||
| if !is_codegen_valid_for(&subxt.metadata()) { | ||
| const WARN_WRONG_VERSION: &str = "connected to a sugondat node with a newer runtime than the one this shim was compiled against. Update the shim lest you run into problems. https://github.com/thrumdev/sugondat"; |
Contributor
There was a problem hiding this comment.
This may be excessive if we ever commit to a stable interface.
rphmeier
approved these changes
Nov 30, 2023
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.

shim: refactor the sugondat rpc client
This changeset makes a couple of fixes and changes:
finalized header.
we assume that the node is still useable, but still warn the user.
keep reconnecting. I imagine this should be useful in cases where we spin up
a local network and the shim started up before the sugondat node (plausible IMO).
Closes #68
Closes #56
Closes #37
There is a follow-up in #77 that performs extraction of
mod conn { }into a separate file.