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

Optionally require a deposit for registering a runtime #2642

Merged
merged 4 commits into from
Feb 10, 2020

Conversation

kostko
Copy link
Member

@kostko kostko commented Feb 4, 2020

Fixes #2638

Also changes the runtime descriptor to include an explicit EntityID and adds a stateful stake accumulator.

@kostko kostko force-pushed the kostko/feature/rt-reg-stake branch 4 times, most recently from 6ed5b09 to 0c2b008 Compare February 4, 2020 14:05
@kostko kostko marked this pull request as ready for review February 4, 2020 14:05
@codecov
Copy link

codecov bot commented Feb 4, 2020

Codecov Report

Merging #2642 into master will decrease coverage by 0.18%.
The diff coverage is 72.99%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2642      +/-   ##
==========================================
- Coverage   62.99%   62.81%   -0.19%     
==========================================
  Files         365      365              
  Lines       34424    34548     +124     
==========================================
+ Hits        21686    21701      +15     
- Misses      10035    10123      +88     
- Partials     2703     2724      +21
Impacted Files Coverage Δ
go/staking/tests/debug/debug_stake.go 60% <ø> (ø) ⬆️
go/oasis-test-runner/oasis/entity.go 0% <0%> (ø) ⬆️
go/oasis-test-runner/oasis/runtime.go 0% <0%> (ø) ⬆️
...nsensus/tendermint/apps/keymanager/transactions.go 0% <0%> (ø) ⬆️
go/registry/api/runtime.go 37.5% <100%> (ø) ⬆️
go/common/entity/entity.go 60.31% <100%> (ø) ⬆️
go/oasis-node/cmd/stake/stake.go 71.79% <100%> (+0.74%) ⬆️
go/common/namespace.go 84% <100%> (ø) ⬆️
go/oasis-node/cmd/registry/runtime/runtime.go 58.01% <100%> (+0.13%) ⬆️
.../consensus/tendermint/apps/registry/state/state.go 73.71% <100%> (-4.1%) ⬇️
... and 34 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 339797f...810c887. Read the comment docs.

@kostko kostko force-pushed the kostko/feature/rt-reg-stake branch 2 times, most recently from 22683ca to 645e736 Compare February 5, 2020 13:12
@kostko kostko added the c:breaking/consensus Category: breaking consensus changes label Feb 5, 2020
@kostko kostko force-pushed the kostko/feature/rt-reg-stake branch 2 times, most recently from ac97a62 to ae52c3f Compare February 6, 2020 10:03
@kostko kostko force-pushed the kostko/feature/rt-reg-stake branch from ae52c3f to ce2ed43 Compare February 6, 2020 14:15
@kostko
Copy link
Member Author

kostko commented Feb 6, 2020

Now also with dynamic runtime E2E tests.

Copy link
Contributor

@Yawning Yawning left a comment

Choose a reason for hiding this comment

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

So there's nothing "wrong" with this from a cursory look, but there is a question about how we want to handle entities that both register a runtime, and operate nodes, since the stake checks are distinct.

Hypothetically say the stake required to operate a node is 3, and the stake required to register a runtime is 2. An entity with a stake of 3 should be able to do one or the other, and not both.

@kostko
Copy link
Member Author

kostko commented Feb 6, 2020 via email

@kostko kostko force-pushed the kostko/feature/rt-reg-stake branch 3 times, most recently from 38a705b to 81bf702 Compare February 7, 2020 12:50
@kostko
Copy link
Member Author

kostko commented Feb 7, 2020

Added stateful stake accumulator, PTAL.

@kostko kostko force-pushed the kostko/feature/rt-reg-stake branch from 81bf702 to 7b88617 Compare February 7, 2020 13:56
Previously the EntityID was inferred from the signed runtime descriptor's
envelope which was inconvenient. This changes the descriptor to be more in line
with what we do for node descriptors.

This also prevents entity deregistrations when an entity owns any runtimes.
Previously there was no central place to account for all the parts that need to
claim some part of an entity's stake which required approximations all around.

This is now changed and a stateful stake accumulator is added to each escrow
account. The stake accumulator is used to track stake claims from different
apps (currently only the registry).

This change also means that node registration will now always require the
correct amount of stake.
@kostko kostko force-pushed the kostko/feature/rt-reg-stake branch from 7b88617 to ce00a2c Compare February 10, 2020 13:25
@kostko kostko force-pushed the kostko/feature/rt-reg-stake branch from ce00a2c to 810c887 Compare February 10, 2020 13:33
@kostko kostko merged commit 9e521ce into master Feb 10, 2020
@kostko kostko deleted the kostko/feature/rt-reg-stake branch February 10, 2020 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:breaking/consensus Category: breaking consensus changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Registering a runtime should require a deposit
2 participants