-
Notifications
You must be signed in to change notification settings - Fork 94
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
detect and resolve chain reorganization #1728
Conversation
Signed-off-by: borngraced <samuelonoja970@gmail.com>
+ unit test for electrum and wasm Signed-off-by: borngraced <samuelonoja970@gmail.com>
Signed-off-by: borngraced <samuelonoja970@gmail.com>
Signed-off-by: borngraced <samuelonoja970@gmail.com>
Signed-off-by: borngraced <samuelonoja970@gmail.com>
Signed-off-by: borngraced <samuelonoja970@gmail.com>
Signed-off-by: borngraced <samuelonoja970@gmail.com>
Signed-off-by: borngraced <samuelonoja970@gmail.com>
Signed-off-by: borngraced <samuelonoja970@gmail.com>
Signed-off-by: borngraced <samuelonoja970@gmail.com>
@borngraced can you please fix CI errors? please also merge with latest dev for CI changes :) |
Signed-off-by: borngraced <samuelonoja970@gmail.com>
Signed-off-by: borngraced <samuelonoja970@gmail.com>
ready now @shamardy |
@borngraced can you please check my latest changes? You are the reviewer now 😅 |
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.
First review check without testing the code
I'll do another review after testing the code
…_count` function in `rpc_clients.rs`
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.
Thanks for the enhancement!
Few notes from my side:
mm2src/coins/utxo/utxo_block_header_storage/sql_block_header_storage.rs
Outdated
Show resolved
Hide resolved
…alculation to avoid doing the incrementing twice
LGTM once CI is green(except the common fails) |
@borngraced this PR is ready for next review from you. |
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.
I try testing the code to see if headers will be downloaded and stored as supposed but unfortunately they're not. I was getting Permanent error: Unknown destination address
on my console.
Permanent Error: rpc_clients:2113] JsonRpcError { client_info: "coin: RICK", request:
JsonRpcRequest { jsonrpc: "2.0", id: "34", method: "blockchain.block.headers", params:
[Number(2), Number(16)] }, error: Internal("Unknown destination address
electrum3.cipig.net:10017") }, on retrieving headers from server electrum3.cipig.net:10017
@borngraced I guess this was during coin activation not after since it tries to get blocks 2-16, you should have checked |
The problem is if the connection was lost during activation only, if it was while mm2 is running, mm2 shouldn't remove the server and will use the other servers until this server is back. I also remember that you mentioned this restart to me while working on an old issue more than a year ago, I remember it was in tuesday if I am not mistaken, so maybe that's what happened when @borngraced was testing. |
They are restarted at different times
the first 2 numbers are minute and hour... the last number is the weekday... 2, 4 and 6... "day of week 0–7 (0 or 7 is Sun, or use names)"... so electrum1 is Tuesday |
Weird, but it's working fine now. tested with BTC also! |
There is an ignored test that tests the BTC block headers sync that I always test before pushing :), that's how I knew this was working |
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.
LGTM 👍🏼 well-done
Verify the parent hash of each block to confirm its consistency with the hash of the preceding block. If it does not match, proceed to backtrack until a match is found. Then, proceed with indexing from the block height of the matched block.
fixes task 7 in #1612