-
Notifications
You must be signed in to change notification settings - Fork 47
feat: F3 e2e lifecycle #1469
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
base: main
Are you sure you want to change the base?
feat: F3 e2e lifecycle #1469
Changes from all commits
1fa0693
264e69d
0c436bd
07160fd
236feab
1b5ac3b
d7935f5
f9ac821
993153e
6d5734b
0736fa6
506de2a
ad80adb
25f5d1c
8a276da
e83f7a3
3bebd91
5027313
e8f4448
bb684ff
b1c9aa2
7c4910e
918aa3d
7680fe5
87c5d44
fae9664
1e41560
a7051da
1e4a297
41ffc97
6e5f8a9
b9a05aa
02493a1
b7f7e30
5d54fea
9c26724
bfb692c
9970708
d5396a2
fbefdde
801c388
c493897
3901b96
a6ce3b9
baaadfb
f259d44
c427732
b0481e3
38506c9
8857277
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ | |
| use crate::types::{LightClientState, PowerEntry}; | ||
| use fil_actors_runtime::runtime::Runtime; | ||
| use fil_actors_runtime::ActorError; | ||
| use fvm_shared::clock::ChainEpoch; | ||
| use serde::{Deserialize, Serialize}; | ||
|
|
||
| /// State of the F3 light client actor. | ||
|
|
@@ -25,25 +26,21 @@ pub struct State { | |
| impl State { | ||
| /// Create a new F3 light client state | ||
| pub fn new( | ||
| instance_id: u64, | ||
| latest_instance_id: u64, | ||
| latest_finalized_height: Option<ChainEpoch>, | ||
| power_table: Vec<PowerEntry>, | ||
| finalized_epochs: Vec<fvm_shared::clock::ChainEpoch>, | ||
| ) -> Result<State, ActorError> { | ||
| let state = State { | ||
| light_client_state: LightClientState { | ||
| instance_id, | ||
| finalized_epochs, | ||
| latest_instance_id, | ||
| latest_finalized_height, | ||
| power_table, | ||
| }, | ||
| }; | ||
| Ok(state) | ||
| } | ||
|
|
||
| /// Update light client state | ||
| /// | ||
| /// This method should only be called from consensus code path which | ||
| /// contains the lightclient verifier. No additional validation is | ||
| /// performed here as it's expected to be done by the verifier. | ||
|
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. Missing validation in F3 Light Client update_stateHigh Severity The Additional Locations (2) |
||
| pub fn update_state( | ||
| &mut self, | ||
| _rt: &impl Runtime, | ||
|
|
||
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.
Test name doesn't match test behavior
Low Severity
The test
test_empty_epochs_rejectedclaims to test rejection of "empty finalized_epochs" per its comment on line 399, but it creates a state withSome(10)forlatest_finalized_heightrather thanNone. This makes it identical totest_update_state_non_advancing_heightinstead of testing the distinct case of a missing/empty finalized height. If the intent was to test rejection ofNone, the test should usecreate_test_state(1, None, ...).