Skip to content

Commit

Permalink
Revert "feat: conditional cbt l1 updates (#2748)"
Browse files Browse the repository at this point in the history
This reverts commit 6d18061.
  • Loading branch information
slowli committed Sep 3, 2024
1 parent 465101e commit e66be51
Show file tree
Hide file tree
Showing 12 changed files with 229 additions and 404 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

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

12 changes: 0 additions & 12 deletions core/lib/config/src/configs/base_token_adjuster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ const DEFAULT_PRICE_FETCHING_SLEEP_MS: u64 = 5_000;
/// Default number of milliseconds to sleep between transaction sending attempts
const DEFAULT_L1_TX_SENDING_SLEEP_MS: u64 = 30_000;

/// Default number of percent that the quote should change in order for update to be propagated to L1
const DEFAULT_L1_UPDATE_DEVIATION_PERCENTAGE: u32 = 10;

/// Default maximum acceptable priority fee in gwei to prevent sending transaction with extremely high priority fee.
const DEFAULT_MAX_ACCEPTABLE_PRIORITY_FEE_IN_GWEI: u64 = 100_000_000_000;

Expand Down Expand Up @@ -82,11 +79,6 @@ pub struct BaseTokenAdjusterConfig {
#[serde(default = "BaseTokenAdjusterConfig::default_l1_tx_sending_sleep_ms")]
pub l1_tx_sending_sleep_ms: u64,

/// How many percent a quote needs to change in order for update to be propagated to L1.
/// Exists to save on gas.
#[serde(default = "BaseTokenAdjusterConfig::default_l1_update_deviation_percentage")]
pub l1_update_deviation_percentage: u32,

/// Maximum number of attempts to fetch quote from a remote API before failing over
#[serde(default = "BaseTokenAdjusterConfig::default_price_fetching_max_attempts")]
pub price_fetching_max_attempts: u32,
Expand Down Expand Up @@ -115,7 +107,6 @@ impl Default for BaseTokenAdjusterConfig {
l1_receipt_checking_sleep_ms: Self::default_l1_receipt_checking_sleep_ms(),
l1_tx_sending_max_attempts: Self::default_l1_tx_sending_max_attempts(),
l1_tx_sending_sleep_ms: Self::default_l1_tx_sending_sleep_ms(),
l1_update_deviation_percentage: Self::default_l1_update_deviation_percentage(),
price_fetching_sleep_ms: Self::default_price_fetching_sleep_ms(),
price_fetching_max_attempts: Self::default_price_fetching_max_attempts(),
halt_on_error: Self::default_halt_on_error(),
Expand Down Expand Up @@ -179,9 +170,6 @@ impl BaseTokenAdjusterConfig {
pub fn default_l1_tx_sending_sleep_ms() -> u64 {
DEFAULT_L1_TX_SENDING_SLEEP_MS
}
pub fn default_l1_update_deviation_percentage() -> u32 {
DEFAULT_L1_UPDATE_DEVIATION_PERCENTAGE
}

pub fn default_price_fetching_sleep_ms() -> u64 {
DEFAULT_PRICE_FETCHING_SLEEP_MS
Expand Down
1 change: 0 additions & 1 deletion core/lib/config/src/testonly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,6 @@ impl Distribution<configs::base_token_adjuster::BaseTokenAdjusterConfig> for Enc
l1_receipt_checking_sleep_ms: self.sample(rng),
l1_tx_sending_max_attempts: self.sample(rng),
l1_tx_sending_sleep_ms: self.sample(rng),
l1_update_deviation_percentage: self.sample(rng),
price_fetching_max_attempts: self.sample(rng),
price_fetching_sleep_ms: self.sample(rng),
halt_on_error: self.sample(rng),
Expand Down
8 changes: 0 additions & 8 deletions core/lib/contracts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ const DIAMOND_INIT_CONTRACT_FILE: (&str, &str) = (
);
const GOVERNANCE_CONTRACT_FILE: (&str, &str) = ("governance", "IGovernance.sol/IGovernance.json");
const CHAIN_ADMIN_CONTRACT_FILE: (&str, &str) = ("governance", "IChainAdmin.sol/IChainAdmin.json");
const GETTERS_FACET_CONTRACT_FILE: (&str, &str) = (
"state-transition/chain-deps/facets",
"Getters.sol/GettersFacet.json",
);

const MULTICALL3_CONTRACT_FILE: (&str, &str) = ("dev-contracts", "Multicall3.sol/Multicall3.json");
const VERIFIER_CONTRACT_FILE: (&str, &str) = ("state-transition", "Verifier.sol/Verifier.json");
Expand Down Expand Up @@ -138,10 +134,6 @@ pub fn chain_admin_contract() -> Contract {
load_contract_for_both_compilers(CHAIN_ADMIN_CONTRACT_FILE)
}

pub fn getters_facet_contract() -> Contract {
load_contract_for_both_compilers(GETTERS_FACET_CONTRACT_FILE)
}

pub fn state_transition_manager_contract() -> Contract {
load_contract_for_both_compilers(STATE_TRANSITION_CONTRACT_FILE)
}
Expand Down
4 changes: 0 additions & 4 deletions core/lib/env_config/src/base_token_adjuster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ mod tests {
l1_tx_sending_sleep_ms: 30_000,
price_fetching_max_attempts: 20,
price_fetching_sleep_ms: 10_000,
l1_update_deviation_percentage: 20,
halt_on_error: true,
}
}
Expand All @@ -46,7 +45,6 @@ mod tests {
l1_tx_sending_sleep_ms: 30_000,
price_fetching_max_attempts: 3,
price_fetching_sleep_ms: 5_000,
l1_update_deviation_percentage: 10,
halt_on_error: false,
}
}
Expand All @@ -64,7 +62,6 @@ mod tests {
BASE_TOKEN_ADJUSTER_L1_RECEIPT_CHECKING_SLEEP_MS=20000
BASE_TOKEN_ADJUSTER_L1_TX_SENDING_MAX_ATTEMPTS=10
BASE_TOKEN_ADJUSTER_L1_TX_SENDING_SLEEP_MS=30000
BASE_TOKEN_ADJUSTER_L1_UPDATE_DEVIATION_PERCENTAGE=20
BASE_TOKEN_ADJUSTER_PRICE_FETCHING_MAX_ATTEMPTS=20
BASE_TOKEN_ADJUSTER_PRICE_FETCHING_SLEEP_MS=10000
BASE_TOKEN_ADJUSTER_HALT_ON_ERROR=true
Expand All @@ -88,7 +85,6 @@ mod tests {
"BASE_TOKEN_ADJUSTER_L1_RECEIPT_CHECKING_SLEEP_MS",
"BASE_TOKEN_ADJUSTER_L1_TX_SENDING_MAX_ATTEMPTS",
"BASE_TOKEN_ADJUSTER_L1_TX_SENDING_SLEEP_MS",
"BASE_TOKEN_ADJUSTER_L1_UPDATE_DEVIATION_PERCENTAGE",
"BASE_TOKEN_ADJUSTER_PRICE_FETCHING_MAX_ATTEMPTS",
"BASE_TOKEN_ADJUSTER_PRICE_FETCHING_SLEEP_MS",
"BASE_TOKEN_ADJUSTER_HALT_ON_ERROR",
Expand Down
4 changes: 0 additions & 4 deletions core/lib/protobuf_config/src/base_token_adjuster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ impl ProtoRepr for proto::BaseTokenAdjuster {
l1_tx_sending_sleep_ms: self
.l1_tx_sending_sleep_ms
.unwrap_or(Self::Type::default_l1_tx_sending_sleep_ms()),
l1_update_deviation_percentage: self
.l1_update_deviation_percentage
.unwrap_or(Self::Type::default_l1_update_deviation_percentage()),
})
}

Expand All @@ -56,7 +53,6 @@ impl ProtoRepr for proto::BaseTokenAdjuster {
l1_receipt_checking_max_attempts: Some(this.l1_receipt_checking_max_attempts),
l1_tx_sending_max_attempts: Some(this.l1_tx_sending_max_attempts),
l1_tx_sending_sleep_ms: Some(this.l1_tx_sending_sleep_ms),
l1_update_deviation_percentage: Some(this.l1_update_deviation_percentage),
price_fetching_max_attempts: Some(this.price_fetching_max_attempts),
price_fetching_sleep_ms: Some(this.price_fetching_sleep_ms),
max_tx_gas: Some(this.max_tx_gas),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ message BaseTokenAdjuster {
optional bool halt_on_error = 10;
optional uint32 price_fetching_max_attempts = 11;
optional uint64 price_fetching_sleep_ms = 12;
optional uint32 l1_update_deviation_percentage = 13;
}
1 change: 0 additions & 1 deletion core/node/base_token_adjuster/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ zksync_eth_client.workspace = true
zksync_node_fee_model.workspace = true
zksync_utils.workspace = true
vise.workspace = true
bigdecimal.workspace = true

tokio = { workspace = true, features = ["time"] }
anyhow.workspace = true
Expand Down
Loading

0 comments on commit e66be51

Please sign in to comment.