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

go/roothash: Refactor runtime messages #3448

Merged
merged 8 commits into from
Dec 2, 2020

Conversation

kostko
Copy link
Member

@kostko kostko commented Oct 26, 2020

Fixes #3430

TODO

  • Validation of per-runtime MaxMessages against global MaxRuntimeMessages roothash consensus parameter.
  • Validation of messages when submitted by transaction scheduler.
  • Emit message processing results.
  • Delivery of message results via RHP.
  • E2E test with a "ping/noop" message.
  • Use height of last successful round instead of height of last round when querying for message results.
  • Update runtime txsource workload to also emit messages.
  • Fix restore from genesis when events were emitted in the last round before dump.

@kostko kostko force-pushed the kostko/feature/runtime-msgs-refactor branch from 575b343 to defd97a Compare October 26, 2020 14:01
@kostko kostko added c:breaking/consensus Category: breaking consensus changes c:breaking/runtime Category: breaking runtime changes labels Oct 26, 2020
@kostko kostko force-pushed the kostko/feature/runtime-msgs-refactor branch 10 times, most recently from 03a811d to 7848257 Compare October 30, 2020 13:18
@kostko kostko marked this pull request as ready for review October 30, 2020 13:18
@kostko kostko force-pushed the kostko/feature/runtime-msgs-refactor branch 2 times, most recently from c8ca0dd to a2ef300 Compare November 2, 2020 13:31
@kostko kostko requested a review from ptrus November 2, 2020 13:32
go/consensus/tendermint/api/app.go Outdated Show resolved Hide resolved
go/roothash/api/api.go Show resolved Hide resolved
go/consensus/tendermint/api/app.go Show resolved Hide resolved
Comment on lines +34 to +37
// Make sure somebody actually handled the message, otherwise treat as unsupported.
if err == tmapi.ErrNoSubscribers {
err = roothash.ErrInvalidArgument
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should have a different/new error for this case to help distinguish it from the actual unsupported message error above?

@kostko kostko force-pushed the kostko/feature/runtime-msgs-refactor branch 2 times, most recently from 754ad83 to 7a4b16d Compare November 10, 2020 12:51
@kostko kostko changed the base branch from master to kostko/fix/runtime-mkvs-overlay November 10, 2020 12:51
@kostko kostko force-pushed the kostko/feature/runtime-msgs-refactor branch from 7a4b16d to 746c5ff Compare November 10, 2020 12:59
@kostko kostko force-pushed the kostko/fix/runtime-mkvs-overlay branch from 05d664b to 2661a29 Compare November 12, 2020 09:17
Base automatically changed from kostko/fix/runtime-mkvs-overlay to master November 12, 2020 10:04
@kostko kostko force-pushed the kostko/feature/runtime-msgs-refactor branch from 746c5ff to 4209836 Compare November 12, 2020 10:09
@codecov
Copy link

codecov bot commented Nov 12, 2020

Codecov Report

Merging #3448 (443b4f5) into master (4578f7d) will increase coverage by 0.02%.
The diff coverage is 65.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3448      +/-   ##
==========================================
+ Coverage   66.44%   66.46%   +0.02%     
==========================================
  Files         373      377       +4     
  Lines       34029    34270     +241     
==========================================
+ Hits        22611    22778     +167     
- Misses       8138     8187      +49     
- Partials     3280     3305      +25     
Impacted Files Coverage Δ
go/common/version/version.go 80.00% <ø> (ø)
go/consensus/tendermint/api/app.go 0.00% <0.00%> (ø)
go/consensus/tendermint/apps/beacon/beacon.go 67.79% <0.00%> (-1.70%) ⬇️
...s/tendermint/apps/epochtime_mock/epochtime_mock.go 64.70% <0.00%> (-1.97%) ⬇️
...consensus/tendermint/apps/keymanager/keymanager.go 66.25% <0.00%> (-0.63%) ⬇️
go/consensus/tendermint/apps/roothash/api.go 100.00% <ø> (ø)
...o/consensus/tendermint/apps/scheduler/scheduler.go 63.58% <0.00%> (-0.31%) ⬇️
go/consensus/tendermint/apps/staking/staking.go 49.25% <0.00%> (-2.24%) ⬇️
...nt/apps/supplementarysanity/supplementarysanity.go 80.00% <0.00%> (-2.00%) ⬇️
go/registry/api/runtime.go 39.16% <ø> (ø)
... and 64 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 4578f7d...443b4f5. Read the comment docs.

@kostko kostko force-pushed the kostko/feature/runtime-msgs-refactor branch 2 times, most recently from 75ff7e4 to 6442aa3 Compare November 24, 2020 10:34
@kostko kostko force-pushed the kostko/feature/runtime-msgs-refactor branch from 6442aa3 to 64136db Compare December 1, 2020 12:19
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.

Some minor comments


// LastNormalRound is the runtime round which was normally processed by the runtime. This is
// also the round that contains the message results for the last processed runtime messages.
LastNormalRound uint64 `json:"last_normal_round"`
Copy link
Member

Choose a reason for hiding this comment

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

Maybe LastNonEmpty{Round,Height} would be more descriptive? Don't have any better suggestion, but i feel "Normal" is not the most descriptive.

Copy link
Member Author

Choose a reason for hiding this comment

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

The reason why I used "Normal" is that this is the header type (HeaderType) of "normal" (:grin:) blocks. I agree that it is not the best term.

Copy link
Member

Choose a reason for hiding this comment

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

Ah yeah that makes sense :-) Potentially could use LastNormalBlock{Round,Height}, but i'm also fine if it stays at it is.

go/registry/api/runtime.go Outdated Show resolved Hide resolved
go/roothash/api/commitment/executor.go Show resolved Hide resolved
go/roothash/api/block/message.go Show resolved Hide resolved
@kostko kostko force-pushed the kostko/feature/runtime-msgs-refactor branch from 64136db to 443b4f5 Compare December 2, 2020 10:08
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.

Looks good, thanks for the updates!

@kostko kostko merged commit 9aedc21 into master Dec 2, 2020
@kostko kostko deleted the kostko/feature/runtime-msgs-refactor branch December 2, 2020 11:21
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 c:breaking/runtime Category: breaking runtime changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor runtime messages
3 participants