Skip to content

Commit

Permalink
chore: fix cargo style
Browse files Browse the repository at this point in the history
  • Loading branch information
uri-99 committed Sep 4, 2024
1 parent 09f6aec commit 7fcc1ca
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
11 changes: 8 additions & 3 deletions batcher/aligned-batcher/src/eth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,17 @@ pub struct CreateNewTaskFeeParams {
}

impl CreateNewTaskFeeParams {
pub fn new(fee_for_aggregator: U256, fee_per_proof: U256, gas_price: U256, max_fee_allowed_to_respond: U256) -> Self {
pub fn new(
fee_for_aggregator: U256,
fee_per_proof: U256,
gas_price: U256,
max_fee_allowed_to_respond: U256,
) -> Self {
CreateNewTaskFeeParams {
fee_for_aggregator,
fee_per_proof,
gas_price,
max_fee_allowed_to_respond
max_fee_allowed_to_respond,
}
}
}
Expand Down Expand Up @@ -99,7 +104,7 @@ pub async fn try_create_new_task(
signatures,
fee_params.fee_for_aggregator,
fee_params.fee_per_proof,
fee_params.max_fee_allowed_to_respond
fee_params.max_fee_allowed_to_respond,
)
.gas_price(fee_params.gas_price);

Expand Down
12 changes: 9 additions & 3 deletions batcher/aligned-batcher/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const ADDITIONAL_SUBMISSION_GAS_COST_PER_PROOF: u128 = 13_000;
const CONSTANT_GAS_COST: u128 = AGGREGATOR_GAS_COST + BATCHER_SUBMISSION_BASE_GAS_COST;
const DEFAULT_MAX_FEE_PER_PROOF: u128 = ADDITIONAL_SUBMISSION_GAS_COST_PER_PROOF * 100_000_000_000; // gas_price = 100 Gwei = 0.0000001 ether (high gas price)
const MIN_FEE_PER_PROOF: u128 = ADDITIONAL_SUBMISSION_GAS_COST_PER_PROOF * 100_000_000; // gas_price = 0.1 Gwei = 0.0000000001 ether (low gas price)
const MAX_FEE_FOR_AGGREGATOR_MULTIPLIER : u128 = 2;
const MAX_FEE_FOR_AGGREGATOR_MULTIPLIER: u128 = 2;

struct BatchState {
batch_queue: BatchQueue,
Expand Down Expand Up @@ -1087,8 +1087,14 @@ impl Batcher {

let fee_per_proof = U256::from(gas_per_proof) * gas_price;
let fee_for_aggregator = U256::from(AGGREGATOR_GAS_COST) * gas_price;
let max_fee_allowed_to_respond = fee_for_aggregator * U256::from(MAX_FEE_FOR_AGGREGATOR_MULTIPLIER);
let fee_params = CreateNewTaskFeeParams::new(fee_for_aggregator, fee_per_proof, gas_price, max_fee_allowed_to_respond);
let max_fee_allowed_to_respond =
fee_for_aggregator * U256::from(MAX_FEE_FOR_AGGREGATOR_MULTIPLIER);
let fee_params = CreateNewTaskFeeParams::new(
fee_for_aggregator,
fee_per_proof,
gas_price,
max_fee_allowed_to_respond,
);

let signatures = signatures
.iter()
Expand Down

0 comments on commit 7fcc1ca

Please sign in to comment.