-
Notifications
You must be signed in to change notification settings - Fork 109
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
runtime: Support consensus event queries #4904
Conversation
8488bcc
to
4446a50
Compare
4446a50
to
b16e00d
Compare
@@ -282,6 +304,7 @@ impl Verifier { | |||
let state_root = state_root_from_header(&verified_block.signed_header); | |||
Ok(ConsensusState::from_protocol( | |||
self.protocol.clone(), | |||
state_root.version + 1, |
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.
Should we move this to from_protocol
?
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.
No because it is specific to the Tendermint consensus backend so IMO it should be determined here. I agree that it is somewhat repetitive here and we could maybe move this into a function.
I've tried to explain this in the ConsensusState
implementation:
pub struct ConsensusState {
// An explicit height field is needed because the relationship between the underlying consensus
// height and the corresponding state root is a consensus backend implementation detail.
height: u64,
b16e00d
to
4b1ac56
Compare
Codecov Report
@@ Coverage Diff @@
## master #4904 +/- ##
==========================================
- Coverage 66.81% 66.76% -0.06%
==========================================
Files 464 464
Lines 51035 51127 +92
==========================================
+ Hits 34099 34133 +34
- Misses 12760 12815 +55
- Partials 4176 4179 +3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
7e9186a
to
8cd3594
Compare
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.
Doesn't this need to bump the runtime host protocol?
var txHash hash.Hash | ||
txHash.Empty() | ||
|
||
// NOTE: These cases should be synced with tests in runtime/src/consensus/staking.rs. |
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.
Long term, instead of hardcoding crap like this, we should start sticking testvectors into JSON files that are used by both test cases.
As this only adds methods, old runtimes should continue to work (which is desirable for an easy migration). It's just that newer runtimes would no longer work on old nodes. Maybe we could bump the minor version, let me check how this is implemented. |
Ah yes, I'll bump the minor RHP version. |
d2e2788
to
e2fcb36
Compare
Bumped. |
e2fcb36
to
fc568b0
Compare
fc568b0
to
9cde8d9
Compare
Based on #4893