-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial commit for debug trace diffs * add geth call traces
- Loading branch information
Showing
17 changed files
with
976 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
use crate::*; | ||
use ethers::prelude::*; | ||
use polars::prelude::*; | ||
use std::collections::HashMap; | ||
|
||
/// columns for transactions | ||
#[cryo_to_df::to_df(Datatype::GethBalanceDiffs)] | ||
#[derive(Default)] | ||
pub struct GethBalanceDiffs { | ||
pub(crate) n_rows: u64, | ||
pub(crate) block_number: Vec<Option<u32>>, | ||
pub(crate) transaction_index: Vec<Option<u64>>, | ||
pub(crate) transaction_hash: Vec<Option<Vec<u8>>>, | ||
pub(crate) address: Vec<Vec<u8>>, | ||
pub(crate) from_value: Vec<U256>, | ||
pub(crate) to_value: Vec<U256>, | ||
pub(crate) chain_id: Vec<u64>, | ||
} | ||
|
||
type Result<T> = ::core::result::Result<T, CollectError>; | ||
|
||
#[async_trait::async_trait] | ||
impl Dataset for GethBalanceDiffs { | ||
fn name() -> &'static str { | ||
"balance_diffs" | ||
} | ||
|
||
fn default_sort() -> Vec<String> { | ||
vec!["block_number".to_string(), "transaction_index".to_string()] | ||
} | ||
} | ||
|
||
#[async_trait::async_trait] | ||
impl CollectByBlock for GethBalanceDiffs { | ||
type Response = <GethStateDiffs as CollectByBlock>::Response; | ||
|
||
async fn extract( | ||
request: Params, | ||
source: Arc<Source>, | ||
schemas: Schemas, | ||
) -> Result<Self::Response> { | ||
<GethStateDiffs as CollectByBlock>::extract(request, source, schemas).await | ||
} | ||
|
||
fn transform(response: Self::Response, columns: &mut Self, schemas: &Schemas) -> Result<()> { | ||
geth_state_diffs::process_geth_diffs(&response, Some(columns), None, None, None, schemas) | ||
} | ||
} | ||
|
||
#[async_trait::async_trait] | ||
impl CollectByTransaction for GethBalanceDiffs { | ||
type Response = <GethStateDiffs as CollectByTransaction>::Response; | ||
|
||
async fn extract( | ||
request: Params, | ||
source: Arc<Source>, | ||
schemas: Schemas, | ||
) -> Result<Self::Response> { | ||
<GethStateDiffs as CollectByTransaction>::extract(request, source, schemas).await | ||
} | ||
|
||
fn transform(response: Self::Response, columns: &mut Self, schemas: &Schemas) -> Result<()> { | ||
geth_state_diffs::process_geth_diffs(&response, Some(columns), None, None, None, schemas) | ||
} | ||
} |
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,64 @@ | ||
use crate::*; | ||
use polars::prelude::*; | ||
use std::collections::HashMap; | ||
|
||
/// columns for transactions | ||
#[cryo_to_df::to_df(Datatype::GethCodeDiffs)] | ||
#[derive(Default)] | ||
pub struct GethCodeDiffs { | ||
pub(crate) n_rows: u64, | ||
pub(crate) block_number: Vec<Option<u32>>, | ||
pub(crate) transaction_index: Vec<Option<u64>>, | ||
pub(crate) transaction_hash: Vec<Option<Vec<u8>>>, | ||
pub(crate) address: Vec<Vec<u8>>, | ||
pub(crate) from_value: Vec<Vec<u8>>, | ||
pub(crate) to_value: Vec<Vec<u8>>, | ||
pub(crate) chain_id: Vec<u64>, | ||
} | ||
|
||
type Result<T> = ::core::result::Result<T, CollectError>; | ||
|
||
#[async_trait::async_trait] | ||
impl Dataset for GethCodeDiffs { | ||
fn name() -> &'static str { | ||
"code_diffs" | ||
} | ||
|
||
fn default_sort() -> Vec<String> { | ||
vec!["block_number".to_string(), "transaction_index".to_string()] | ||
} | ||
} | ||
|
||
#[async_trait::async_trait] | ||
impl CollectByBlock for GethCodeDiffs { | ||
type Response = <GethStateDiffs as CollectByBlock>::Response; | ||
|
||
async fn extract( | ||
request: Params, | ||
source: Arc<Source>, | ||
schemas: Schemas, | ||
) -> Result<Self::Response> { | ||
<GethStateDiffs as CollectByBlock>::extract(request, source, schemas).await | ||
} | ||
|
||
fn transform(response: Self::Response, columns: &mut Self, schemas: &Schemas) -> Result<()> { | ||
geth_state_diffs::process_geth_diffs(&response, None, Some(columns), None, None, schemas) | ||
} | ||
} | ||
|
||
#[async_trait::async_trait] | ||
impl CollectByTransaction for GethCodeDiffs { | ||
type Response = <GethStateDiffs as CollectByTransaction>::Response; | ||
|
||
async fn extract( | ||
request: Params, | ||
source: Arc<Source>, | ||
schemas: Schemas, | ||
) -> Result<Self::Response> { | ||
<GethStateDiffs as CollectByTransaction>::extract(request, source, schemas).await | ||
} | ||
|
||
fn transform(response: Self::Response, columns: &mut Self, schemas: &Schemas) -> Result<()> { | ||
geth_state_diffs::process_geth_diffs(&response, None, Some(columns), None, None, schemas) | ||
} | ||
} |
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,64 @@ | ||
use crate::*; | ||
use ethers::prelude::*; | ||
use polars::prelude::*; | ||
use std::collections::HashMap; | ||
|
||
/// columns for transactions | ||
#[cryo_to_df::to_df(Datatype::GethNonceDiffs)] | ||
#[derive(Default)] | ||
pub struct GethNonceDiffs { | ||
pub(crate) n_rows: u64, | ||
pub(crate) block_number: Vec<Option<u32>>, | ||
pub(crate) transaction_index: Vec<Option<u64>>, | ||
pub(crate) transaction_hash: Vec<Option<Vec<u8>>>, | ||
pub(crate) address: Vec<Vec<u8>>, | ||
pub(crate) from_value: Vec<U256>, | ||
pub(crate) to_value: Vec<U256>, | ||
pub(crate) chain_id: Vec<u64>, | ||
} | ||
type Result<T> = ::core::result::Result<T, CollectError>; | ||
|
||
#[async_trait::async_trait] | ||
impl Dataset for GethNonceDiffs { | ||
fn name() -> &'static str { | ||
"nonce_diffs" | ||
} | ||
|
||
fn default_sort() -> Vec<String> { | ||
vec!["block_number".to_string(), "transaction_index".to_string()] | ||
} | ||
} | ||
|
||
#[async_trait::async_trait] | ||
impl CollectByBlock for GethNonceDiffs { | ||
type Response = <GethStateDiffs as CollectByBlock>::Response; | ||
|
||
async fn extract( | ||
request: Params, | ||
source: Arc<Source>, | ||
schemas: Schemas, | ||
) -> Result<Self::Response> { | ||
<GethStateDiffs as CollectByBlock>::extract(request, source, schemas).await | ||
} | ||
|
||
fn transform(response: Self::Response, columns: &mut Self, schemas: &Schemas) -> Result<()> { | ||
geth_state_diffs::process_geth_diffs(&response, None, None, Some(columns), None, schemas) | ||
} | ||
} | ||
|
||
#[async_trait::async_trait] | ||
impl CollectByTransaction for GethNonceDiffs { | ||
type Response = <GethStateDiffs as CollectByTransaction>::Response; | ||
|
||
async fn extract( | ||
request: Params, | ||
source: Arc<Source>, | ||
schemas: Schemas, | ||
) -> Result<Self::Response> { | ||
<GethStateDiffs as CollectByTransaction>::extract(request, source, schemas).await | ||
} | ||
|
||
fn transform(response: Self::Response, columns: &mut Self, schemas: &Schemas) -> Result<()> { | ||
geth_state_diffs::process_geth_diffs(&response, None, None, Some(columns), None, schemas) | ||
} | ||
} |
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,65 @@ | ||
use crate::*; | ||
use polars::prelude::*; | ||
use std::collections::HashMap; | ||
|
||
/// columns for transactions | ||
#[cryo_to_df::to_df(Datatype::GethStorageDiffs)] | ||
#[derive(Default)] | ||
pub struct GethStorageDiffs { | ||
pub(crate) n_rows: u64, | ||
pub(crate) block_number: Vec<Option<u32>>, | ||
pub(crate) transaction_index: Vec<Option<u64>>, | ||
pub(crate) transaction_hash: Vec<Option<Vec<u8>>>, | ||
pub(crate) address: Vec<Vec<u8>>, | ||
pub(crate) slot: Vec<Vec<u8>>, | ||
pub(crate) from_value: Vec<Vec<u8>>, | ||
pub(crate) to_value: Vec<Vec<u8>>, | ||
pub(crate) chain_id: Vec<u64>, | ||
} | ||
|
||
#[async_trait::async_trait] | ||
impl Dataset for GethStorageDiffs { | ||
fn name() -> &'static str { | ||
"geth_storage_diffs" | ||
} | ||
|
||
fn default_sort() -> Vec<String> { | ||
vec!["block_number".to_string(), "transaction_index".to_string()] | ||
} | ||
} | ||
|
||
type Result<T> = ::core::result::Result<T, CollectError>; | ||
|
||
#[async_trait::async_trait] | ||
impl CollectByBlock for GethStorageDiffs { | ||
type Response = <GethStateDiffs as CollectByBlock>::Response; | ||
|
||
async fn extract( | ||
request: Params, | ||
source: Arc<Source>, | ||
schemas: Schemas, | ||
) -> Result<Self::Response> { | ||
<GethStateDiffs as CollectByBlock>::extract(request, source, schemas).await | ||
} | ||
|
||
fn transform(response: Self::Response, columns: &mut Self, schemas: &Schemas) -> Result<()> { | ||
geth_state_diffs::process_geth_diffs(&response, None, None, None, Some(columns), schemas) | ||
} | ||
} | ||
|
||
#[async_trait::async_trait] | ||
impl CollectByTransaction for GethStorageDiffs { | ||
type Response = <GethStateDiffs as CollectByTransaction>::Response; | ||
|
||
async fn extract( | ||
request: Params, | ||
source: Arc<Source>, | ||
schemas: Schemas, | ||
) -> Result<Self::Response> { | ||
<GethStateDiffs as CollectByTransaction>::extract(request, source, schemas).await | ||
} | ||
|
||
fn transform(response: Self::Response, columns: &mut Self, schemas: &Schemas) -> Result<()> { | ||
geth_state_diffs::process_geth_diffs(&response, None, None, None, Some(columns), schemas) | ||
} | ||
} |
Oops, something went wrong.