Skip to content
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-sdk: Add support for consensus staking #1122

Merged
merged 4 commits into from May 30, 2023

Conversation

kostko
Copy link
Member

@kostko kostko commented Sep 15, 2022

Based on #1118

@kostko kostko force-pushed the kostko/feature/oasis-core-22.2.0 branch from d044912 to b89a21e Compare September 19, 2022 12:35
@kostko kostko force-pushed the kostko/feature/consensus-staking branch from 7453bfc to 722549d Compare September 19, 2022 12:35
@kostko kostko force-pushed the kostko/feature/oasis-core-22.2.0 branch from b89a21e to e709852 Compare September 22, 2022 16:45
@kostko kostko force-pushed the kostko/feature/consensus-staking branch from 722549d to 9be92c0 Compare September 22, 2022 16:48
@kostko kostko force-pushed the kostko/feature/oasis-core-22.2.0 branch 2 times, most recently from 97f1b19 to c57d8fc Compare September 28, 2022 07:50
@kostko kostko force-pushed the kostko/feature/consensus-staking branch from 9be92c0 to c3f8549 Compare September 28, 2022 09:03
@kostko kostko force-pushed the kostko/feature/oasis-core-22.2.0 branch from c57d8fc to 4bfe14f Compare September 29, 2022 11:47
@kostko kostko force-pushed the kostko/feature/consensus-staking branch from c3f8549 to e2850eb Compare September 29, 2022 11:50
@kostko kostko force-pushed the kostko/feature/oasis-core-22.2.0 branch from 4bfe14f to ac4dcbb Compare October 4, 2022 09:50
@kostko kostko force-pushed the kostko/feature/consensus-staking branch from e2850eb to 847c5b4 Compare October 4, 2022 09:52
@kostko kostko force-pushed the kostko/feature/oasis-core-22.2.0 branch from ac4dcbb to bf5068d Compare October 17, 2022 10:19
@kostko kostko force-pushed the kostko/feature/consensus-staking branch from 847c5b4 to 804f1ae Compare October 17, 2022 10:32
@kostko kostko force-pushed the kostko/feature/oasis-core-22.2.0 branch 5 times, most recently from 83f0ca0 to 5da8b45 Compare October 21, 2022 11:35
@kostko kostko force-pushed the kostko/feature/consensus-staking branch from 804f1ae to 59d4176 Compare October 21, 2022 12:31
@kostko kostko force-pushed the kostko/feature/oasis-core-22.2.0 branch 2 times, most recently from 60ca501 to e1dc067 Compare November 7, 2022 09:04
Base automatically changed from kostko/feature/oasis-core-22.2.0 to main November 8, 2022 11:04
@kostko kostko force-pushed the kostko/feature/consensus-staking branch from 59d4176 to 7c9d931 Compare January 6, 2023 13:41
@codecov
Copy link

codecov bot commented Jan 6, 2023

Codecov Report

Merging #1122 (dd60093) into main (733f7ca) will increase coverage by 0.59%.
The diff coverage is 69.29%.

@@            Coverage Diff             @@
##             main    #1122      +/-   ##
==========================================
+ Coverage   55.70%   56.30%   +0.59%     
==========================================
  Files         124      126       +2     
  Lines        8652     8987     +335     
==========================================
+ Hits         4820     5060     +240     
- Misses       3790     3885      +95     
  Partials       42       42              
Impacted Files Coverage Δ
runtime-sdk/src/dispatcher.rs 13.69% <0.00%> (-0.25%) ⬇️
...untime-sdk/src/modules/consensus_accounts/types.rs 100.00% <ø> (ø)
runtime-sdk/src/modules/rewards/mod.rs 70.42% <18.18%> (-8.69%) ⬇️
runtime-sdk/src/testing/mock.rs 83.72% <20.00%> (-8.39%) ⬇️
runtime-sdk/src/history.rs 44.44% <44.44%> (ø)
runtime-sdk/src/context.rs 69.16% <55.55%> (+0.22%) ⬆️
runtime-sdk/src/modules/accounts/mod.rs 80.56% <60.00%> (-0.33%) ⬇️
runtime-sdk/src/modules/consensus/mod.rs 78.04% <60.00%> (-4.61%) ⬇️
runtime-sdk/src/modules/consensus_accounts/mod.rs 65.99% <68.20%> (+6.59%) ⬆️
...untime-sdk/src/modules/consensus_accounts/state.rs 85.71% <85.71%> (ø)
... and 2 more

... and 1 file with indirect coverage changes

@kostko kostko force-pushed the kostko/feature/consensus-staking branch from 7c9d931 to 3915e02 Compare January 10, 2023 08:49
@kostko kostko force-pushed the kostko/feature/consensus-staking branch 3 times, most recently from ab617aa to 6fae30c Compare March 6, 2023 10:25
@kostko kostko force-pushed the kostko/feature/consensus-staking branch from 6fae30c to 8162d9d Compare May 26, 2023 19:48
@kostko kostko marked this pull request as ready for review May 26, 2023 19:51
@kostko kostko requested review from pro-wh and ptrus as code owners May 26, 2023 19:51
Copy link
Member

@ptrus ptrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self TODO: check the main part of the PR, changes in the consensus_accounts module.

runtime-sdk/src/modules/accounts/mod.rs Outdated Show resolved Hide resolved
}

// Resolve height for the given epoch.
let mut height = HEIGHT_LATEST;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor, probably irrelevant? improvement: could start at the height of the smallest cached epoch that is higher than epoch.

@kostko kostko force-pushed the kostko/feature/consensus-staking branch 3 times, most recently from 55c2983 to 656ade4 Compare May 30, 2023 09:03
Also remove the module-specific epoch tracking from the rewards module
and bump its version to v2 with a migration removing the old tracking
state.
@kostko kostko force-pushed the kostko/feature/consensus-staking branch from 656ade4 to a9c3b1d Compare May 30, 2023 10:07
@kostko kostko force-pushed the kostko/feature/consensus-staking branch from a9c3b1d to dd60093 Compare May 30, 2023 10:19
@kostko kostko merged commit bce8460 into main May 30, 2023
27 checks passed
@kostko kostko deleted the kostko/feature/consensus-staking branch May 30, 2023 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants