Skip to content

Commit f61bb32

Browse files
committed
Commented out error logs; refactored contract handling
1 parent eb02049 commit f61bb32

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

crates/rpc/rpc-layer/src/jwt_validator.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::{AuthValidator, JwtError, JwtSecret};
22
use http::{header, HeaderMap, Response, StatusCode};
33
use jsonrpsee_http_client::{HttpBody, HttpResponse};
4-
use tracing::error;
4+
// use tracing::error;
55

66
/// Implements JWT validation logics and integrates
77
/// to an Http [`AuthLayer`][crate::AuthLayer]
@@ -26,14 +26,14 @@ impl AuthValidator for JwtAuthValidator {
2626
Some(jwt) => match self.secret.validate(&jwt) {
2727
Ok(_) => Ok(()),
2828
Err(e) => {
29-
error!(target: "engine::jwt-validator", "Invalid JWT: {e}");
29+
// error!(target: "engine::jwt-validator", "Invalid JWT: {e}");
3030
let response = err_response(e);
3131
Err(response)
3232
}
3333
},
3434
None => {
3535
let e = JwtError::MissingOrInvalidAuthorizationHeader;
36-
error!(target: "engine::jwt-validator", "Invalid JWT: {e}");
36+
// error!(target: "engine::jwt-validator", "Invalid JWT: {e}");
3737
let response = err_response(e);
3838
Err(response)
3939
}

crates/taiko/rpc/src/api.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ where
415415
this.eth_api.tx_resp_builder(),
416416
)?;
417417

418-
let BundleState { state: bundle_state, contracts, .. } = state;
418+
let BundleState { state: bundle_state, .. } = state;
419419

420420
let state = this.eth_api.state_at_block_id(block_hash.into())?;
421421
let parent_state = db.db.into_inner();
@@ -437,6 +437,7 @@ where
437437

438438
let mut account_proofs = vec![];
439439
let mut parent_account_proofs = vec![];
440+
let mut contracts = HashMap::new();
440441

441442
for (address, account) in bundle_state {
442443
let storage_keys: Vec<B256> =
@@ -453,17 +454,20 @@ where
453454
.proof(Default::default(), address, storage_keys.as_slice())
454455
.map_err(Eth::Error::from_eth_err)?;
455456
account_proofs.push(proof.into_eip1186_response(keys));
457+
458+
if let Some(original_info) = account.original_info {
459+
if let Some(code) = original_info.code {
460+
contracts.insert(original_info.code_hash, code.bytes());
461+
}
462+
}
456463
}
457464

458465
Ok(ProvingPreflight {
459466
block: rpc_block,
460467
parent_header: rpc_parent_block.header,
461468
account_proofs,
462469
parent_account_proofs,
463-
contracts: contracts
464-
.into_iter()
465-
.map(|(k, v)| (k, v.original_bytes()))
466-
.collect(),
470+
contracts,
467471
ancestor_headers,
468472
})
469473
})

0 commit comments

Comments
 (0)