-
Notifications
You must be signed in to change notification settings - Fork 186
fix: broadcast HeadChange::Revert(Tipset) in set_heaviest_tipset #6732
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
Open
hanabi1224
wants to merge
11
commits into
main
Choose a base branch
from
hm/head-change-revert
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
3888ede
fix: broadcast HeadChange::Revert(Tipset) in set_heaviest_tipset
hanabi1224 4c59008
resolve AI comments
hanabi1224 b26e0c2
resolve comments
hanabi1224 a758183
resolve comments
hanabi1224 b7c0d19
fix
hanabi1224 29dccb6
Merge remote-tracking branch 'origin/main' into hm/head-change-revert
hanabi1224 20df24c
fix
hanabi1224 d753d31
fix
hanabi1224 c6b0c0c
fix
hanabi1224 843febe
fix
hanabi1224 279d588
checks for chain_get_path
hanabi1224 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -226,15 +226,25 @@ where | |
| let mut repub = false; | ||
| let mut rmsgs: HashMap<Address, HashMap<u64, SignedMessage>> = HashMap::new(); | ||
| for ts in revert { | ||
| let pts = api.load_tipset(ts.parents())?; | ||
| let Ok(pts) = api.load_tipset(ts.parents()) else { | ||
| tracing::error!("error loading reverted tipset parent"); | ||
|
Contributor
Author
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. Forgive errors to match Lotus at https://github.com/filecoin-project/lotus/blob/58b5475d1ec1dc9e4b2808c8fbd86a62c8934905/chain/messagepool/messagepool.go#L1343 |
||
| continue; | ||
| }; | ||
| *cur_tipset.write() = pts; | ||
|
|
||
| let mut msgs: Vec<SignedMessage> = Vec::new(); | ||
| for block in ts.block_headers() { | ||
| let (umsg, smsgs) = api.messages_for_block(block)?; | ||
| let Ok((umsg, smsgs)) = api.messages_for_block(block) else { | ||
| tracing::error!("error retrieving messages for reverted block"); | ||
| continue; | ||
| }; | ||
| msgs.extend(smsgs); | ||
| for msg in umsg { | ||
| let smsg = recover_sig(bls_sig_cache, msg)?; | ||
| let msg_cid = msg.cid(); | ||
| let Ok(smsg) = recover_sig(bls_sig_cache, msg) else { | ||
| tracing::debug!("could not recover signature for bls message {}", msg_cid); | ||
| continue; | ||
| }; | ||
| msgs.push(smsg) | ||
| } | ||
| } | ||
|
|
@@ -246,7 +256,10 @@ where | |
|
|
||
| for ts in apply { | ||
| for b in ts.block_headers() { | ||
| let (msgs, smsgs) = api.messages_for_block(b)?; | ||
| let Ok((msgs, smsgs)) = api.messages_for_block(b) else { | ||
| tracing::error!("error retrieving messages for block"); | ||
| continue; | ||
| }; | ||
|
|
||
| for msg in smsgs { | ||
| remove_from_selected_msgs( | ||
|
|
||
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.