Skip to content
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

A0-3392 Finality checks for eth #27

Merged
merged 34 commits into from
Dec 12, 2023
Merged

Conversation

krzysztofziobro
Copy link
Collaborator

@krzysztofziobro krzysztofziobro commented Nov 14, 2023

Adding finality checks for Ethereum side.
Comes with some fixes to encoding/decoding, enables performing funds "round trip", so bridging in both directions using relayer (tested manually).

This does not provide a proper finished implementation of crash recovery, what's to be added in later PRs:

  • Opening of multiple parallel connections to aleph node during long crash recoveries to reduce the impact of latency in block fetching.
  • Bounding number of tokio tasks that handle the events. (done)
  • Dry-running before sending a receive_request transaction to reduce number of unnecessary calls during crash recovery.
  • (potentially) spawn another task that will handle recent blocks not to block ongoing bridge operation

@krzysztofziobro krzysztofziobro marked this pull request as ready for review December 4, 2023 16:30
relayer/src/config.rs Outdated Show resolved Hide resolved
Comment on lines 371 to 381
info!(" Decoded event data:");
info!(
" dest_token_address: 0x{}",
hex::encode(dest_token_address)
);
info!(" amount: {amount}");
info!(
" dest_receiver_address: 0x{}",
hex::encode(dest_receiver_address)
);
info!(" request_nonce: {request_nonce}\n");
Copy link
Collaborator

@fbielejec fbielejec Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log it in one line, it will make sifting through logs a lot easier in the future when we need to triangulate problems

if let Some(name) = &event.name {
if name.eq("CrosschainTransferRequest") {
info!("handling A0 contract event: {event:?}");
info!("Handling A0 contract event...");
Copy link
Collaborator

@fbielejec fbielejec Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either log some data or remove this log line, imo it's useless unless it carries some information to identify the request

Copy link
Collaborator

@fbielejec fbielejec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leaving some comments, but looks quite good already

@krzysztofziobro
Copy link
Collaborator Author

Made a slight rework of how to limit number of tasks so that more requests can be handled at the same time.

@krzysztofziobro krzysztofziobro merged commit 3537e48 into master Dec 12, 2023
4 checks passed
@krzysztofziobro krzysztofziobro deleted the A0-3392-eth-finality-checks branch December 12, 2023 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants