-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
analyzer/consensus: Full Cobalt support. Internal types for node responses. #356
Merged
Conversation
This file contains 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
mitjat
force-pushed
the
mitjat/cobalt-consensus
branch
from
March 15, 2023 21:36
ebc4080
to
c3e4ead
Compare
mitjat
changed the title
consensus: Internal types for node responses
analyzer/consensus: Full Cobalt support. Internal types for node responses.
Mar 15, 2023
mitjat
force-pushed
the
mitjat/cobalt-consensus
branch
from
March 16, 2023 16:54
c3e4ead
to
fb9209f
Compare
pro-wh
reviewed
Mar 17, 2023
pro-wh
reviewed
Mar 17, 2023
mitjat
force-pushed
the
mitjat/cobalt-consensus
branch
from
March 17, 2023 22:32
fb9209f
to
026afd1
Compare
mitjat
force-pushed
the
mitjat/cobalt-consensus
branch
from
March 20, 2023 17:39
026afd1
to
67f980b
Compare
mitjat
force-pushed
the
mitjat/cobalt-consensus
branch
from
March 21, 2023 22:54
67f980b
to
d369c98
Compare
pro-wh
approved these changes
Mar 21, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's try it out with this. haven't read through, but the regression test passing is a good sign
Andrew7234
approved these changes
Mar 22, 2023
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.
Task 1:
#326 introduces a new
CobaltConsensusApiLite
struct whose methods wrap the oasis-node API: They speak cobalt-style gRPC to the node, then convert the response to indexer-internal types. OnlyGetGenesisDocument()
is implemented for now; follow that pattern to implement the remaining methods.Implementation note: For simpler methods, try parsing the node output directly as the indexer-internal (= Damask oasis-core) type, so that no conversion is necessary. Some types are bound to not have changed between Cobalt and Damask.
Task 2:
Data pulled from the node is currently converted into v22.2.5 (= oasis-3-compatible) oasis-core types. When oasis-4 comes out, we have two options:
While the first option will work in a pinch, the second option is clearly cleaner and more sustainable long-term.
Warren mentioned that the indexer already has its own internal types: whatever we put in the db tables. However, those are
So the goal is to have
ConsensusApiLite
andRuntimeApiLite
return types that have no oasis-core dependencies. Everything else flows from there.This PR:
ConsensusApiLite
(introduced in refactor: Initial support for Cobalt nodes #326), an interface that unifies communication with Cobalt and Damask nodes.The latter has considerable fallout, and introduces considerable boilerplate :/. That said, it's the best solution I see. Re-posting my Slack reasoning for visibility:
Testing:
staking.allowance_change
events. The old analyzer stored the base64-encoded JSON representation, but all other events are just plain JSON. This PR fixes that.{''}
. Now, it's correctly{}
. (Curlies are how postgres represents arrays.) That said, I see those addresses are now deprecated anyway :). Same for P2P addresses, which are not deprecated.'
at beginning and end); fixed now.