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

Implement perconfirmation distribution across the P2P network #71

Merged
merged 5 commits into from
Aug 22, 2024

Conversation

mikhailUshakoff
Copy link
Collaborator

No description provided.

@@ -5,19 +5,36 @@ use secp256k1::{ecdsa::Signature, Message, Secp256k1, SecretKey};
use serde::{Deserialize, Serialize};
use tiny_keccak::{Hasher, Keccak};

// TODO add chain id to taiko
const CHAIN_ID: [u8; 32] = [0u8; 32];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want to add a chain id as config parameter?

let block: Block = p2p_message.into();
tracing::debug!("Node received message from p2p: {:?}", block);
// TODO: add block to preconfirmation queue
let msg: PreconfirmationMessage = p2p_message.into();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would be nice to move the code for p2p message handling, into separate function

}
}
} else {
tracing::warn!("Hash mismatch or failed to calculate hash.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not match result from L2TxListsCommit::from_preconf(msg.block_height, msg.tx_list_bytes).hash()?
It would be possible to print the error from the hash function.

} else {
tracing::error!("Failed to check signature");
}
}
Copy link
Collaborator

@mskrzypkows mskrzypkows Aug 20, 2024

Choose a reason for hiding this comment

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

@smartprogrammer93 should we prove incorrect preconfirmation if the hash from the P2P message is wrong? Or just wait for blockProposed event and prove it then? And the same with the verification of the signature.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I've just seen in the: https://www.notion.so/nethermind/EXT-Design-Doc-Taiko-Preconfirmation-PoC-74db78ff89df4aa8983ed1e640a05359?pvs=4#6e4d601afbeb481795a90894533627a0
That we ignore wrong preconfirmations from the P2P.
@mikhailUshakoff let's just log that we ignore it

tracing::error!("Failed to advance head: {}", e);
}
} else {
tracing::error!("Failed to check signature");
Copy link
Collaborator

Choose a reason for hiding this comment

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

As above, printing error would be helpful :-)

@@ -195,6 +196,8 @@ impl Config {
boot_nodes,
};

let taiko_chain_id = 1u64;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's read it from the ENV var.

@mikhailUshakoff mikhailUshakoff merged commit ffc10d8 into master Aug 22, 2024
1 check passed
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