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: Fix verification of blocks between two trusted heights #5134

Merged
merged 2 commits into from
Jan 16, 2023

Conversation

kostko
Copy link
Member

@kostko kostko commented Jan 13, 2023

Updates tendermint-rs to include our fix from informalsystems/tendermint-rs#1247.

@kostko kostko force-pushed the kostko/fix/lc-verify-before-ltr branch from 3c26dd5 to bff9daf Compare January 13, 2023 13:27
@kostko kostko marked this pull request as ready for review January 13, 2023 13:29
@kostko kostko force-pushed the kostko/fix/lc-verify-before-ltr branch from bff9daf to ec95484 Compare January 13, 2023 13:34
@codecov
Copy link

codecov bot commented Jan 13, 2023

Codecov Report

Merging #5134 (08ccab5) into master (634a230) will decrease coverage by 0.23%.
The diff coverage is n/a.

❗ Current head 08ccab5 differs from pull request most recent head 5b03671. Consider uploading reports for the commit 5b03671 to get more accurate results

@@            Coverage Diff             @@
##           master    #5134      +/-   ##
==========================================
- Coverage   66.99%   66.76%   -0.24%     
==========================================
  Files         496      496              
  Lines       53275    53275              
==========================================
- Hits        35692    35567     -125     
- Misses      13255    13352      +97     
- Partials     4328     4356      +28     
Impacted Files Coverage Δ
...onsensus/tendermint/apps/beacon/state/state_vrf.go 73.33% <0.00%> (-13.34%) ⬇️
go/runtime/host/sgx/epid.go 64.47% <0.00%> (-10.53%) ⬇️
go/runtime/host/protocol/connection.go 64.28% <0.00%> (-9.78%) ⬇️
go/runtime/host/sandbox/sandbox.go 68.62% <0.00%> (-7.94%) ⬇️
go/common/cbor/codec.go 78.37% <0.00%> (-5.41%) ⬇️
go/worker/beacon/tx_retry.go 90.47% <0.00%> (-4.77%) ⬇️
go/consensus/tendermint/apps/registry/query.go 76.00% <0.00%> (-4.00%) ⬇️
go/common/sgx/aesm/aesm.go 44.13% <0.00%> (-3.29%) ⬇️
go/runtime/registry/host.go 66.89% <0.00%> (-3.22%) ⬇️
go/consensus/tendermint/abci/state.go 72.85% <0.00%> (-2.86%) ⬇️
... and 36 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@kostko kostko requested a review from peternose January 14, 2023 20:02
Copy link
Contributor

@peternose peternose left a comment

Choose a reason for hiding this comment

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

Running cargo update shows some packages were just updated.

[[package]]
name = "clap"
-version = "4.0.32"
+version = "4.1.1"

[[package]]
name = "clap_lex"
-version = "0.3.0"
+version = "0.3.1"

runtime/src/consensus/tendermint/verifier/store/state.rs Outdated Show resolved Hide resolved
runtime/src/consensus/tendermint/verifier/store/lru.rs Outdated Show resolved Hide resolved
runtime/src/consensus/tendermint/verifier/store/lru.rs Outdated Show resolved Hide resolved
runtime/src/consensus/tendermint/verifier/store/lru.rs Outdated Show resolved Hide resolved
runtime/src/consensus/tendermint/verifier/mod.rs Outdated Show resolved Hide resolved
/// runtime's untrusted local store fails.
///
pub fn save(&self, store: &Box<dyn LightStore>) {
let lowest_block = store.lowest(Status::Trusted).unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to panic here? As load can return an empty vector of trusted blocks, I would also allow that in save. We can pass trust_root to this function and use it when the highest block is not available.

Copy link
Member Author

Choose a reason for hiding this comment

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

This would never panic in practice as the light store always has at least one block (e.g. at least the trust root added during initialization).

Copy link
Contributor

Choose a reason for hiding this comment

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

I know, just thought it would be nice to remove panics.

runtime/src/consensus/tendermint/verifier/store/lru.rs Outdated Show resolved Hide resolved
@kostko kostko force-pushed the kostko/fix/lc-verify-before-ltr branch from ec95484 to 08ccab5 Compare January 16, 2023 10:40
@kostko
Copy link
Member Author

kostko commented Jan 16, 2023

Updated, please take another look.

@kostko kostko enabled auto-merge January 16, 2023 12:42
@kostko kostko force-pushed the kostko/fix/lc-verify-before-ltr branch from 08ccab5 to 5b03671 Compare January 16, 2023 15:59
@kostko kostko merged commit cbaa6b0 into master Jan 16, 2023
@kostko kostko deleted the kostko/fix/lc-verify-before-ltr branch January 16, 2023 17:01
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.

3 participants