-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from NethermindEth/mu/preconf-distr
Implement perconfirmation distribution across the P2P network
- Loading branch information
Showing
9 changed files
with
154 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
pub mod block; | ||
pub mod block_proposed; | ||
pub mod commit; | ||
pub mod config; | ||
pub mod preconfirmation_message; | ||
pub mod preconfirmation_proof; | ||
pub mod rpc_client; | ||
pub mod rpc_server; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use crate::utils::preconfirmation_proof::PreconfirmationProof; | ||
use serde::{Deserialize, Serialize}; | ||
use serde_json::Value; | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize)] | ||
pub struct PreconfirmationMessage { | ||
pub block_height: u64, | ||
pub tx_lists: Value, | ||
pub tx_list_bytes: Vec<u8>, | ||
pub gas_used: u64, | ||
pub proof: PreconfirmationProof, | ||
} | ||
|
||
impl From<PreconfirmationMessage> for Vec<u8> { | ||
fn from(val: PreconfirmationMessage) -> Self { | ||
bincode::serialize(&val).expect("Serialization failed") | ||
} | ||
} | ||
|
||
impl From<Vec<u8>> for PreconfirmationMessage { | ||
fn from(bytes: Vec<u8>) -> Self { | ||
bincode::deserialize(&bytes).expect("Deserialization failed") | ||
} | ||
} |
8 changes: 4 additions & 4 deletions
8
Node/src/utils/block.rs → Node/src/utils/preconfirmation_proof.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters