-
Notifications
You must be signed in to change notification settings - Fork 27
feat: implement p2p layer and broadcast flashblocks #275
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
base: main
Are you sure you want to change the base?
Conversation
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.
How are you handling the race conditions p2p introduces? Like if two builder build different flashblocks or something like that.
Not really sure what's happening in the p2p crate, please make sure it's documented well so that others can contribute easily
crates/p2p/src/behaviour.rs
Outdated
} | ||
|
||
#[allow(clippy::large_enum_variant)] | ||
#[derive(Debug)] |
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.
You can use derive_more::From
to get rid of the manual From impls below
} | ||
|
||
impl NodeBuilder { | ||
pub fn new() -> Self { |
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.
Derive default instead?
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.
there is default()
also, I like having both
loop { | ||
match reader.next().await { | ||
Some(Ok(str)) => { | ||
let payload: M = serde_json::from_str(&str) |
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.
Shouldn't deserialization happen in op-rbuilder code?
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 originally had it there, i was debating if the serialization format should be internal or external to the p2p layer. i'm going to refactor this to not be json anyways. could change the p2p layer back to just handle Bytes
instead of Message
if you prefer that
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.
sounds good, i'll look again after you refactor
out of scope for this PR, i am assuming the high availability setup will be used where op-conductor will manage which party is building at a specific time.
yes will add! PR is still draft, not ready for review yet tbh, will ping you again when it's fully ready. |
&self.evm_config | ||
} | ||
|
||
pub(super) fn into_op_payload_builder_ctx( |
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.
why not for conversions between the types?
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'm probably going to remove this function after cleanup
📝 Summary
future extensions:
💡 Motivation and Context
see https://hackmd.io/@nZ-twauPRISEa6G9zg3XRw/H1fekrwolx
✅ I have completed the following steps:
make lint
make test