-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix: restart ws connection to rpc when it was dropped and sync lost blocks #227
Conversation
|
||
error!("{chain_kind:?} WebSocket stream closed unexpectedly, reconnecting..."); | ||
start_block = None; |
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.
This is done to make sure that first start uses start_block
(if it was provided as an argument) and then we need to switch back to using last_processed_block
. Let me know if this should be refactored using better code practices
Also, same logic can be found in solana startup files
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.
Usually, it is done in this way:
let mut last_processed_block = start_block.unwrap_or(redis.get_last_processed_block());
loop {
lake::start(last_processed_block, &mut last_processed_block)
}
But you implementation is ok for now
|
||
error!("{chain_kind:?} WebSocket stream closed unexpectedly, reconnecting..."); | ||
start_block = None; |
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.
Usually, it is done in this way:
let mut last_processed_block = start_block.unwrap_or(redis.get_last_processed_block());
loop {
lake::start(last_processed_block, &mut last_processed_block)
}
But you implementation is ok for now
* feat: added message field for solana transfers * feat: provided more context in logs (#225) * feat: provided more context in logs * chore: updated omni-types * chore: retry if attached deposit is too low * chore: remove event if signature verification failed * chore: added release relayer (#226) * chore: added release relayer * chore: try to adjust repo url * chore: change workdir * chore: rename * chore: bring back correct yml * chore: update contracts tag trigger * chore: moved dist to correct place * fix: deleted musl target * fix: restart ws connection to rpc when it was dropped and sync lost blocks (#227)
We found an issue when connection can be dropped right when new event should be found, so we need to fetch everything from the last_processed_block
![image](https://private-user-images.githubusercontent.com/59515280/409766850-b1980c3e-2250-4582-ba38-28a84b81d9a4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMzY2NTUsIm5iZiI6MTczOTMzNjM1NSwicGF0aCI6Ii81OTUxNTI4MC80MDk3NjY4NTAtYjE5ODBjM2UtMjI1MC00NTgyLWJhMzgtMjhhODRiODFkOWE0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDA0NTkxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTkxMTNlZjE4ZThiNjIxYmY3ZWU2MmZjYTFkNGU1YmRjZDYxYzk4NDhmZGRmNjUyYzIzOWQzYmRkOThjMTQ3ODUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.VJig0zREwPE3bm4PX_AnK1xtlNi5r-LpWoT95a0HDVY)
![image](https://private-user-images.githubusercontent.com/59515280/409766909-be43c184-36fe-4996-b177-95900549dcd8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMzY2NTUsIm5iZiI6MTczOTMzNjM1NSwicGF0aCI6Ii81OTUxNTI4MC80MDk3NjY5MDktYmU0M2MxODQtMzZmZS00OTk2LWIxNzctOTU5MDA1NDlkY2Q4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDA0NTkxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM5MTgwMzZlMGJhNTZjOTM0ZDNkOGJlMDI1MDBjM2M2NDExNDcwMmY3ZDdiYTI3MjliNGQxODQyNmQ4YzNiYjgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ztDovH1wQuBBnWRRhUAOq28crvnOeHdZomGinjDUPBg)