diff --git a/crates/networking/rpc/eth/account.rs b/crates/networking/rpc/eth/account.rs index 283d83b3f..953999daa 100644 --- a/crates/networking/rpc/eth/account.rs +++ b/crates/networking/rpc/eth/account.rs @@ -156,9 +156,8 @@ impl RpcHandler for GetTransactionCountRequest { ); let Some(block_number) = self.block.resolve_block_number(&storage)? else { - return Err(RpcErr::Internal( - "Could not resolve block number".to_owned(), - )); // Should we return Null here? + return serde_json::to_value("0x0") + .map_err(|error| RpcErr::Internal(error.to_string())); }; let nonce = storage diff --git a/crates/networking/rpc/types/block_identifier.rs b/crates/networking/rpc/types/block_identifier.rs index a995b35d2..5b596ccad 100644 --- a/crates/networking/rpc/types/block_identifier.rs +++ b/crates/networking/rpc/types/block_identifier.rs @@ -39,7 +39,15 @@ impl BlockIdentifier { BlockTag::Finalized => storage.get_finalized_block_number(), BlockTag::Safe => storage.get_safe_block_number(), BlockTag::Latest => storage.get_latest_block_number(), - BlockTag::Pending => storage.get_pending_block_number(), + BlockTag::Pending => { + storage + .get_pending_block_number() + // If there are no pending blocks, we return the latest block number + .and_then(|pending_block_number| match pending_block_number { + Some(block_number) => Ok(Some(block_number)), + None => storage.get_latest_block_number(), + }) + } }, } } diff --git a/test_data/el-stability-check.yml b/test_data/el-stability-check.yml index 6b4a38a64..d28765a06 100644 --- a/test_data/el-stability-check.yml +++ b/test_data/el-stability-check.yml @@ -24,7 +24,7 @@ tasks: - name: run_task_matrix title: "Check block proposals from all client pairs" - timeout: 2m + timeout: 3m configVars: matrixValues: "validatorPairNames" config: diff --git a/test_data/network_params.yaml b/test_data/network_params.yaml index cbb4ac117..d2c4fc7ec 100644 --- a/test_data/network_params.yaml +++ b/test_data/network_params.yaml @@ -20,4 +20,6 @@ assertoor_params: run_block_proposal_check: false run_blob_transaction_test: true tests: - - 'https://raw.githubusercontent.com/lambdaclass/lambda_ethereum_rust/refs/heads/main/test_data/el-stability-check.yml' \ No newline at end of file + - 'https://raw.githubusercontent.com/lambdaclass/lambda_ethereum_rust/refs/heads/main/test_data/el-stability-check.yml' +tx_spammer_params: + tx_spammer_extra_args: ["--accounts=10", --txcount=10]