Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/fastlane #315

Merged
merged 3 commits into from
Jun 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: propagated user operation from gossipsub
Vid201 committed Jun 16, 2024
commit ade4545dfb69441313f4c0c82b43df696a8b8ae6
2 changes: 1 addition & 1 deletion Cross.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build]
pre-build = [
"apt-get update && apt-get -y upgrade && apt-get install -y wget pkg-config llvm-dev libclang-6.0-dev clang-6.0 libssl-dev",
"apt-get update && apt-get -y upgrade && apt-get install -y wget pkg-config llvm-dev libclang-6.0-dev clang-6.0 libssl-dev ca-certificates",
"wget -c https://github.com/ethereum/solidity/releases/download/v0.8.20/solc-static-linux && mv solc-static-linux /usr/local/bin/solc && chmod a+x /usr/local/bin/solc"
]

2 changes: 1 addition & 1 deletion bin/silius/src/bundler.rs
Original file line number Diff line number Diff line change
@@ -516,7 +516,7 @@ where
if let Some(chain) = chain {
if !CHAINS.contains(&chain) {
warn!("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
warn!("Chain {:?} is not officially supported yet! You could possibly meet a lot of problems with silius. Use at your own risk!!", chain);
warn!("Chain {:?} is not officially supported yet! You could possibly meet a lot of problems with Silius. Use at your own risk!", chain);
warn!("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
}

14 changes: 9 additions & 5 deletions crates/mempool/src/validate/sanity/sender.rs
Original file line number Diff line number Diff line change
@@ -51,11 +51,15 @@ impl<M: Middleware> SanityCheck<M> for Sender {
return Ok(());
}

let uo_prev = mempool
.get_all_by_sender(&uo.sender)
.iter()
.find(|uo_prev| uo_prev.nonce == uo.nonce)
.cloned();
let mut uo_prev: Option<UserOperation> = None;

if !helper.val_config.ignore_prev {
uo_prev = mempool
.get_all_by_sender(&uo.sender)
.iter()
.find(|uo_prev| uo_prev.nonce == uo.nonce)
.cloned();
}

if let Some(uo_prev) = uo_prev {
if uo.max_fee_per_gas <
2 changes: 2 additions & 0 deletions crates/mempool/src/validate/validator.rs
Original file line number Diff line number Diff line change
@@ -251,6 +251,7 @@ where
min_stake: Some(reputation.min_stake()),
min_unstake_delay: Some(reputation.min_unstake_delay()),
topic: None,
ignore_prev: false,
};
}

@@ -269,6 +270,7 @@ where
if let Some(uo) = mempool.get_prev_by_sender(uo) {
out.prev_hash = Some(uo.hash);
}

debug!("Simulate user operation from {:?}", uo.sender);
let sim_res = self.simulate_validation(uo).await?;

5 changes: 4 additions & 1 deletion crates/p2p/src/service/mod.rs
Original file line number Diff line number Diff line change
@@ -304,6 +304,7 @@ impl Network {
min_stake: Some(canonical_mempool_config.min_stake),
min_unstake_delay: None,
topic: Some(message.topic.to_string()),
ignore_prev: false,
}
})
.expect("mempool channel should be open all the time");
@@ -424,7 +425,7 @@ impl Network {
verified_at_block_hash,
validation_config,
} => {
info!("Received user {user_operation:?} from ep {ep:?} verified in {verified_at_block_hash:?} to gossip over p2p!");
info!("Received user operation (verified at {verified_at_block_hash:?}) to gossip over p2p: {user_operation:?}");

let user_op = VerifiedUserOperation::new(
user_operation.user_operation.clone(),
@@ -444,6 +445,7 @@ impl Network {
min_stake: Some(first_mempool_config.min_stake),
min_unstake_delay: None,
topic: Some(first_mempool_topic.to_string()),
ignore_prev: true,
},
})
.expect("mempool channel should be open all the time");
@@ -463,6 +465,7 @@ impl Network {
min_stake: Some(canonical_mempool_config.min_stake),
min_unstake_delay: None,
topic: Some(canonical_mempool_topic.to_string()),
ignore_prev: true,
},
})
.expect("mempool channel should be open all the time");
1 change: 1 addition & 0 deletions crates/primitives/src/simulation.rs
Original file line number Diff line number Diff line change
@@ -45,6 +45,7 @@ pub struct ValidationConfig {
pub min_stake: Option<U256>,
pub min_unstake_delay: Option<U256>,
pub topic: Option<String>,
pub ignore_prev: bool,
}

/// Code hash - hash of the code of the contract