Skip to content

Commit

Permalink
feat: ⚡ Refacto of mc-deoxys + bonsai commitments for tx/event + sync…
Browse files Browse the repository at this point in the history
… with upstream
  • Loading branch information
antiyro committed Feb 9, 2024
1 parent 42d086b commit 9776449
Show file tree
Hide file tree
Showing 15 changed files with 116 additions and 406 deletions.
46 changes: 23 additions & 23 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"build": {
"dockerfile": "Dockerfile"
},
"build": {
"dockerfile": "Dockerfile"
},

// make sure to update `.devcontainer/Dockerfile` with you uid !!!
"remoteUser": "vscode",
// make sure to update `.devcontainer/Dockerfile` with you uid !!!
"remoteUser": "vscode",

"customizations": {
"vscode": {
"settings": {
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.profiles.linux": { "zsh": { "path": "/bin/zsh" } }
},
"extensions": [
"rust-lang.rust-analyzer",
"1YiB.rust-bundle",
"tamasfe.even-better-toml",
"serayuzgur.crates",
"vivaxy.vscode-conventional-commits",
"streetsidesoftware.code-spell-checker"
]
}
},
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.profiles.linux": { "zsh": { "path": "/bin/zsh" } }
},
"extensions": [
"rust-lang.rust-analyzer",
"1YiB.rust-bundle",
"tamasfe.even-better-toml",
"serayuzgur.crates",
"vivaxy.vscode-conventional-commits",
"streetsidesoftware.code-spell-checker"
]
}
},

"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
"postAttachCommand": "${containerWorkspaceFolder}/.devcontainer/setup.sh"
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
"postAttachCommand": "${containerWorkspaceFolder}/.devcontainer/setup.sh"
}
10 changes: 5 additions & 5 deletions Cargo.lock

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

7 changes: 0 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,6 @@ cairo-vm = { git = "https://github.com/keep-starknet-strange/cairo-rs", branch =
"cairo-1-hints",
"parity-scale-codec",
] }
# starknet-accounts = { git = "https://github.com/jbcaron/starknet-rs.git", branch = "classes", default-features = false }
# starknet-contract = { git = "https://github.com/jbcaron/starknet-rs.git", branch = "classes", default-features = false }
# starknet-core = { git = "https://github.com/jbcaron/starknet-rs.git", branch = "classes", default-features = false }
# starknet-crypto = { git = "https://github.com/jbcaron/starknet-rs.git", branch = "classes", default-features = false }
# starknet-ff = { git = "https://github.com/jbcaron/starknet-rs.git", branch = "classes", default-features = false }
# starknet-providers = { git = "https://github.com/jbcaron/starknet-rs.git", branch = "classes", default-features = false }
# starknet-signers = { git = "https://github.com/jbcaron/starknet-rs.git", branch = "classes", default-features = false }

# temporary fokr fix for `failed deserialization when accessible_scopes is missing`
# until we can update to commit c974e5c is starknet-rs
Expand Down
2 changes: 1 addition & 1 deletion crates/client/db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub(crate) mod columns {

/// This column contains the Sierra contract classes
pub const SIERRA_CONTRACT_CLASSES: u32 = 7;

/// This column stores the fee paid on l1 for L1Handler transactions
pub const L1_HANDLER_PAID_FEE: u32 = 8;

Expand Down
5 changes: 2 additions & 3 deletions crates/client/deoxys/src/l2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ use starknet_providers::{Provider, SequencerGatewayProvider};
use tokio::sync::mpsc::Sender;
use tokio::task::JoinSet;

use crate::state_updates::StarknetStateUpdate;
use crate::utility::{get_block_hash_by_number, update_highest_block_hash_and_number};
use crate::CommandSink;

Expand Down Expand Up @@ -317,7 +316,7 @@ async fn download_class(
block_hash: FieldElement,
provider: Arc<SequencerGatewayProvider>,
) -> anyhow::Result<ContractClassData> {
log::info!("💾 Downloading class {class_hash:#x}");
// log::info!("💾 Downloading class {class_hash:#x}");
let core_class = provider.get_class(BlockIdCore::Hash(block_hash), class_hash).await?;

// Core classes have to be converted into Blockifier classes to gain support
Expand Down Expand Up @@ -416,7 +415,7 @@ pub fn update_l2(state_update: L2StateUpdate) {
}

/// Verify the L2 state according to the latest state update
pub async fn verify_l2(_state_update: StarknetStateUpdate) -> Result<(), String> {
pub async fn verify_l2(_state_update: StateUpdateWrapper) -> Result<(), String> {
// 1. Retrieve state diff
// 2. Compute commitments
// state_root = state_commitment(csd)
Expand Down
1 change: 0 additions & 1 deletion crates/client/deoxys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ pub mod types;
pub mod utils;

pub use l2::{FetchConfig, SenderConfig};
pub use types::state_updates;
pub use utils::{convert, m, utility};

type CommandSink = futures::channel::mpsc::Sender<sc_consensus_manual_seal::rpc::EngineCommand<sp_core::H256>>;
Expand Down
2 changes: 1 addition & 1 deletion crates/client/deoxys/src/types/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pub mod state_updates;
//! Mod for types used in Deoxys.
Loading

0 comments on commit 9776449

Please sign in to comment.