-
Notifications
You must be signed in to change notification settings - Fork 86
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
[bitcoin_move] Improve reorg and pending block #2691
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Manifest Files |
@@ -308,6 +311,13 @@ module bitcoin_move::pending_block{ | |||
}; | |||
let block_hash = *simple_map::borrow(&store.pending_blocks, &ready_block_height); | |||
let block_obj = borrow_pending_block(block_hash); | |||
let prev_block_hash = types::prev_blockhash(&object::borrow(block_obj).header); | |||
while(exists_pending_block(prev_block_hash)){ |
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.
这段代码是为了确保 penging 区块即使在排序异常的情况下,也能优先处理最早的区块?
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.
原来的逻辑下,pending 的 block 要恰好比 reorg count 多 1,如果否则就会把后面的块先处理了。
} | ||
|
||
fun handle_reog(store: &mut PendingStore, reorg_block_height: u64){ | ||
fun handle_reorg(store: &mut PendingStore, reorg_block_height: u64){ |
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.
直接 remove private 的 fun,有没有兼容性问题?
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.
private fun 可以随便改。
Summary
[bitcoin_move] Improve reorg and pending block logic.
[test] Add reorg failed test case
[rpc] Add
rooch_status
API to get the rpc service, Rooch, and Bitcoin status.relative issue: #2653