-
Notifications
You must be signed in to change notification settings - Fork 115
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
Roothash processing fees #2504
Merged
Merged
Roothash processing fees #2504
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
5f58a03
go/consensus/tendermint/apps/roothash: Move transactions to its own file
kostko 0df8cda
go/consensus/tendermint/apps/roothash: Split compute/merge processing
kostko 3d1af01
runtime: Fix (some) compile warnings during tests
kostko 1044bd4
go/consensus/tendermint/apps/roothash: Refactor onCommitteeChanged
kostko f385104
go/consensus/tendermint/abci: Fix context Rollback
kostko 2e4545e
go/roothash: Add gas costs and suspend runtimes for non-payment
kostko 71e6374
go/oasis-test-runner: Make CLI helpers more reusable
kostko b7a02aa
go/oasis-test-runner: Add dynamic runtime registration tests
kostko b00d7f2
go/worker/common: Wait for keymanager to become available
kostko 80cb5dd
go: Bump lint deadline to 2m
kostko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Charge gas for runtime transactions and suspend runtimes which do not pay periodic maintenance fees. | ||
|
||
This introduces gas fees for submitting roothash commitments from runtime nodes. Since periodic | ||
maintenance work must be performed on each epoch transition (e.g., electing runtime committees), | ||
fees for that maintenance are paid by any nodes that register to perform work for a specific | ||
runtime. Fees are pre-paid for the number of epochs a node registers for. | ||
|
||
If the maintenance fees are not paid, the runtime gets suspended (so periodic work is not needed) | ||
and must be resumed by registering nodes. |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,6 +75,25 @@ func (app *registryApplication) InitChain(ctx *abci.Context, request types.Reque | |
} | ||
} | ||
} | ||
for _, v := range st.SuspendedRuntimes { | ||
app.logger.Debug("InitChain: Registering genesis suspended runtime", | ||
"runtime_owner", v.Signature.PublicKey, | ||
) | ||
if err := app.registerRuntime(ctx, state, v); err != nil { | ||
app.logger.Error("InitChain: failed to register runtime", | ||
"err", err, | ||
"runtime", v, | ||
) | ||
return errors.Wrap(err, "registry: genesis suspended runtime registration failure") | ||
} | ||
var rt registry.Runtime | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of doing this, just make Otherwise, the |
||
if err := cbor.Unmarshal(v.Blob, &rt); err != nil { | ||
return errors.Wrap(err, "registry: malformed genesis suspended runtime") | ||
} | ||
if err := state.SuspendRuntime(rt.ID); err != nil { | ||
return errors.Wrap(err, "registry: failed to suspend runtime at genesis") | ||
} | ||
} | ||
for _, v := range st.Nodes { | ||
app.logger.Debug("InitChain: Registering genesis node", | ||
"node_owner", v.Signature.PublicKey, | ||
|
@@ -120,6 +139,10 @@ func (rq *registryQuerier) Genesis(ctx context.Context) (*registry.Genesis, erro | |
if err != nil { | ||
return nil, err | ||
} | ||
suspendedRuntimes, err := rq.state.SuspendedRuntimes() | ||
if err != nil { | ||
return nil, err | ||
} | ||
signedNodes, err := rq.state.SignedNodes() | ||
if err != nil { | ||
return nil, err | ||
|
@@ -149,11 +172,12 @@ func (rq *registryQuerier) Genesis(ctx context.Context) (*registry.Genesis, erro | |
} | ||
|
||
gen := registry.Genesis{ | ||
Parameters: *params, | ||
Entities: signedEntities, | ||
Runtimes: signedRuntimes, | ||
Nodes: validatorNodes, | ||
NodeStatuses: nodeStatuses, | ||
Parameters: *params, | ||
Entities: signedEntities, | ||
Runtimes: signedRuntimes, | ||
SuspendedRuntimes: suspendedRuntimes, | ||
Nodes: validatorNodes, | ||
NodeStatuses: nodeStatuses, | ||
} | ||
return &gen, nil | ||
} |
Oops, something went wrong.
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.
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.
At some point we should probably just add in hacks to the scheduler that just schedules things "correctly" for the byzantine tests.