Skip to content

Commit

Permalink
feat(katana): revert blockifier bump (#2979)
Browse files Browse the repository at this point in the history
* feat: downgrade `blockifier`

* use rev

* update test db
  • Loading branch information
kariy authored Feb 1, 2025
1 parent a9e65a3 commit 12d9c8d
Show file tree
Hide file tree
Showing 15 changed files with 334 additions and 511 deletions.
162 changes: 60 additions & 102 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 crates/katana/cairo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cairo-lang-starknet = "2.7.0"
cairo-lang-starknet-classes = "2.7.0"
cairo-lang-utils = "2.7.0"
cairo-vm = "1.0.1"
starknet_api = { git = "https://github.com/dojoengine/sequencer", rev = "802c5dc" }
starknet_api = { git = "https://github.com/dojoengine/sequencer", rev = "adae779" }

[features]
# Some types that we used from cairo-vm implements the `Arbitrary` trait,
Expand Down
9 changes: 1 addition & 8 deletions crates/katana/core/src/backend/gas_oracle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,7 @@ impl GasOracle {
///
/// The result of this is the same as running the node with fee disabled.
pub fn sampled_starknet() -> Self {
Self::fixed(GasPrices { eth: 0, strk: 0 }, GasPrices { eth: 0, strk: 0 })
}

/// Returns a fixed gas oracle with zero gas prices.
///
/// Mainly used for testing purposes.
pub fn zero() -> Self {
Self::fixed(GasPrices { eth: 0, strk: 0 }, GasPrices { eth: 0, strk: 0 })
Self::fixed(GasPrices { eth: 1, strk: 1 }, GasPrices { eth: 1, strk: 1 })
}

/// Returns the current gas prices.
Expand Down
2 changes: 1 addition & 1 deletion crates/katana/core/tests/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fn backend_with_db(chain_spec: &ChainSpec, provider: impl Database) -> Backend<B
Backend::new(
chain_spec.clone().into(),
Blockchain::new(provider),
GasOracle::zero(),
GasOracle::sampled_starknet(),
executor(chain_spec),
)
}
Expand Down
2 changes: 1 addition & 1 deletion crates/katana/executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ katana-trie.workspace = true
thiserror.workspace = true
tracing.workspace = true

blockifier = { git = "https://github.com/dojoengine/sequencer", rev = "802c5dc", features = [ "testing" ], optional = true }
blockifier = { git = "https://github.com/dojoengine/sequencer", rev = "adae779", features = [ "testing" ], optional = true }
parking_lot = { workspace = true, optional = true }
starknet = { workspace = true, optional = true }

Expand Down
5 changes: 3 additions & 2 deletions crates/katana/executor/src/implementation/blockifier/error.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use blockifier::execution::errors::{EntryPointExecutionError, PreExecutionError};
use blockifier::execution::execution_utils::format_panic_data;
use blockifier::state::errors::StateError;
use blockifier::transaction::errors::{
TransactionExecutionError, TransactionFeeError, TransactionPreValidationError,
Expand Down Expand Up @@ -31,8 +32,8 @@ impl From<TransactionExecutionError> for ExecutionError {
impl From<EntryPointExecutionError> for ExecutionError {
fn from(error: EntryPointExecutionError) -> Self {
match error {
EntryPointExecutionError::ExecutionFailed { error_trace } => {
Self::ExecutionFailed { reason: error_trace.to_string() }
EntryPointExecutionError::ExecutionFailed { error_data } => {
Self::ExecutionFailed { reason: format_panic_data(&error_data) }
}
EntryPointExecutionError::InvalidExecutionInput { input_descriptor, info } => {
Self::InvalidInput { input_descriptor, info }
Expand Down
Loading

0 comments on commit 12d9c8d

Please sign in to comment.