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

kona patch 10-17 #28

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions bin/host/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ use std::{
io::{stderr, stdin, stdout},
os::fd::{AsFd, AsRawFd},
panic::AssertUnwindSafe,
process::Command,
sync::Arc,
};
use tokio::{process::Command, sync::RwLock, task};
use tokio::{sync::RwLock, task};
use tracing::{debug, error, info};
use util::Pipe;

Expand Down Expand Up @@ -213,7 +214,7 @@ pub async fn start_native_client_program(
])
.expect("No errors may occur when mapping file descriptors.");

let status = command.status().await.map_err(|e| {
let status = command.status().map_err(|e| {
error!(target: "client_program", "Failed to execute client program: {:?}", e);
anyhow!("Failed to execute client program: {:?}", e)
})?;
Expand Down
9 changes: 8 additions & 1 deletion crates/mpt/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,15 @@ impl TrieNode {
}

/// Returns the commitment of a [TrieNode::Blinded] node, if `self` is of the
/// [TrieNode::Blinded] variant.
/// [TrieNode::Blinded] or [TrieNode::Empty] variants.
///
/// ## Returns
/// - `Some(B256)` - The commitment of the blinded node
/// - `None` - `self` is not a [TrieNode::Blinded] node
pub const fn blinded_commitment(&self) -> Option<B256> {
match self {
Self::Blinded { commitment } => Some(*commitment),
Self::Empty => Some(EMPTY_ROOT_HASH),
_ => None,
}
}
Expand Down Expand Up @@ -681,6 +682,12 @@ mod test {
use alloy_trie::{HashBuilder, Nibbles};
use rand::prelude::SliceRandom;

#[test]
fn test_empty_blinded() {
let trie_node = TrieNode::Empty;
assert_eq!(trie_node.blinded_commitment().unwrap(), EMPTY_ROOT_HASH);
}

#[test]
fn test_decode_branch() {
const BRANCH_RLP: [u8; 83] = hex!("f851a0eb08a66a94882454bec899d3e82952dcc918ba4b35a09a84acd98019aef4345080808080808080a05d87a81d9bbf5aee61a6bfeab3a5643347e2c751b36789d988a5b6b163d496518080808080808080");
Expand Down
Loading