Skip to content

Commit

Permalink
test: debug raw block (kkrt-labs#894)
Browse files Browse the repository at this point in the history
* boyscout commit: remove dotenv

* add `debug_getRawBlock/get-invalid-number` and update README
  • Loading branch information
greged93 authored Mar 26, 2024
1 parent bc577bc commit 95dc526
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 23 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ jobs:
include:
- debug_getRawReceipts
- debug_getRawTransaction/get-tx$
- debug_getRawBlock/get-invalid-number$
- eth_blockNumber/simple-test$
- eth_call/call-simple-contract$
- eth_call/call-simple-transfer$
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ anyhow = { version = "1.0.68", default-features = false }
async-trait = { version = "0.1.58", default-features = false }
auto_impl = { version = "1.1.0", default-features = false }
bytes = { version = "1", default-features = false }
dotenv = { version = "0.15.0", default-features = false }
dotenvy = { version = "0.15", default-features = false }
env_logger = { version = "0.10.0", default-features = false }
eyre = { version = "0.6.8", default-features = false }

Expand Down
22 changes: 9 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,9 @@ by the Kakarot RPC.
For the [hive rpc compatibility tests](https://github.com/kkrt-labs/hive/tree/master/simulators/ethereum/rpc-compat),
the following tests are skipped:

- debug_getRawBlock/get-block-n: debug API is currently not supported by the
Kakarot RPC.
- debug_getRawBlock/get-genesis: debug API is currently not supported by the
Kakarot RPC.
- debug_getRawBlock/get-invalid-number: debug API is currently not supported by the
Kakarot RPC.
- debug_getRawBlock/get-block-n: the Kakarot implementation currently
doesn't compute the block hash following EVM standards.
- debug_getRawBlock/get-genesis: see `debug_getRawBlock/get-block-n`.
- debug_getRawHeader/get-block-n: debug API is currently not supported by the
Kakarot RPC.
- debug_getRawHeader/get-genesis: debug API is currently not supported by the
Expand All @@ -273,12 +270,11 @@ the following tests are skipped:
- eth_feeHistory/fee-history: the Kakarot implementation doesn't currently
set the block gas limit dynamically, which causes some disparity in the
returned data. Additionally, the rewards of the blocks aren't available.
- eth_getBalance/get-balance-blockhash: the Kakarot implementation currently
doesn't compute the block hash following EVM standards .
- eth_getBlockByHash/get-block-by-hash: see `eth_getBalance/get-balance-blockhash`.
- eth_getBlockReceipts/get-block-receipts-by-hash: see `eth_getBalance/get-balance-blockhash`.
- eth_getBlockTransactionCountByHash/get-block-n: see `eth_getBalance/get-balance-blockhash`.
- eth_getBlockTransactionCountByHash/get-genesis: see `eth_getBalance/get-balance-blockhash`.
- eth_getBalance/get-balance-blockhash: see `debug_getRawBlock/get-block-n`.
- eth_getBlockByHash/get-block-by-hash: see `debug_getRawBlock/get-block-n`.
- eth_getBlockReceipts/get-block-receipts-by-hash: see `debug_getRawBlock/get-block-n`.
- eth_getBlockTransactionCountByHash/get-block-n: see `debug_getRawBlock/get-block-n`.
- eth_getBlockTransactionCountByHash/get-genesis: see `debug_getRawBlock/get-block-n`.
- eth_getProof/get-account-proof-blockhash: the getProof endpoint is currently
not supported by the Kakarot RPC.
- eth_getProof/get-account-proof-with-storage: the getProof endpoint is currently
Expand All @@ -298,7 +294,7 @@ the following tests are skipped:
code of `-32602` which corresponds to an invalid parameters error, whenever
it encounters issues when deserializing the input. We decide to ignore this
test as the only issue is the error code returned.
- eth_getTransactionByBlockHashAndIndex/get-block-n: see `eth_getBalance/get-balance-blockhash`.
- eth_getTransactionByBlockHashAndIndex/get-block-n: see `debug_getRawBlock/get-block-n`.

In addition to the tests we skip, some of the objects fields need to be ignored in
the passing tests:
Expand Down
2 changes: 1 addition & 1 deletion src/bin/hive_genesis.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use dotenv::dotenv;
use dotenvy::dotenv;
use kakarot_rpc::test_utils::{hive::HiveGenesisConfig, katana::genesis::KatanaGenesisBuilder};
use starknet_crypto::FieldElement;
use std::{env::var, path::Path};
Expand Down
2 changes: 1 addition & 1 deletion src/bin/katana_genesis.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use dotenv::dotenv;
use dotenvy::dotenv;
use ethers::types::U256;
use kakarot_rpc::test_utils::katana::genesis::KatanaGenesisBuilder;
use lazy_static::lazy_static;
Expand Down
2 changes: 1 addition & 1 deletion src/eth_provider/starknet/kakarot_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::str::FromStr;
use crate::models::felt::Felt252Wrapper;
use alloy_rlp::Encodable;
use cainome::rs::abigen_legacy;
use dotenv::dotenv;
use dotenvy::dotenv;
use lazy_static::lazy_static;
use reth_primitives::{Address, Transaction, TransactionSigned};
use starknet::{
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::env::var;
use std::sync::Arc;

use dotenv::dotenv;
use dotenvy::dotenv;
use eyre::Result;
use kakarot_rpc::config::{JsonRpcClientBuilder, KakarotRpcConfig, Network, SequencerGatewayProviderBuilder};
use kakarot_rpc::eth_provider::database::Database;
Expand Down
2 changes: 1 addition & 1 deletion src/test_utils/katana/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl Katana {
/// Initializes the Katana test environment.
async fn initialize(sequencer: TestSequencer, starknet_provider: Arc<JsonRpcClient<HttpTransport>>) -> Self {
// Load PK
dotenv::dotenv().expect("Failed to load .env file");
dotenvy::dotenv().expect("Failed to load .env file");
let pk = std::env::var("EVM_PRIVATE_KEY").expect("Failed to get EVM private key");
let pk = B256::from_str(&pk).expect("Failed to parse EVM private key");

Expand Down

0 comments on commit 95dc526

Please sign in to comment.