diff --git a/etherlink/CHANGES_KERNEL.md b/etherlink/CHANGES_KERNEL.md index 81be5a38f25f9a404e229f09f1691e12a5e3f4c9..7901814db9d9ff5130da84859de84d2408029809 100644 --- a/etherlink/CHANGES_KERNEL.md +++ b/etherlink/CHANGES_KERNEL.md @@ -2,7 +2,7 @@ ## Version NEXT -Its storage version is 35. +Its storage version is 36. ### Features @@ -15,6 +15,8 @@ Its storage version is 35. with over-estimated gas limits exceeding the maximum threshold will be disabled. During execution, any gas limit above the maximum will be automatically capped at the maximum permitted value. (!18179) +- Bump the capacity of Etherlink to 8MGas/s (meaning a target per second to + 4MGas/s). (!18452) ### Bug fixes diff --git a/etherlink/bin_node/lib_dev/gas_price.ml b/etherlink/bin_node/lib_dev/gas_price.ml index c0562d0abc8e4571ee5c8acbb2580a6f0d8983b0..5847625a8c312df4398f8feeb9f361e3c0aef794 100644 --- a/etherlink/bin_node/lib_dev/gas_price.ml +++ b/etherlink/bin_node/lib_dev/gas_price.ml @@ -14,15 +14,18 @@ type constants = {target : Z.t; alpha : float} let ticks_constants = {target = Z.of_int (40_000_000 * 50); alpha = 0.000_000_000_007} -let gas_constants = - let capacity = 4_000_000 in - {target = Z.of_int (capacity / 2); alpha = 0.000_000_007} +let gas_constants version = + let capacity, alpha = + if version < 36 (* Dionysus or before *) then (4_000_000, 0.000_000_007) + else (8_000_000, 0.000_000_004) + in + {target = Z.of_int (capacity / 2); alpha} let tolerance {target; _} = Z.(mul target (of_int 10)) let constants_from_storage_version version = (* See migrations V32 in [migration.rs] *) - if version < 32 then ticks_constants else gas_constants + if version < 32 then ticks_constants else gas_constants version let price_from_backlog ~version ~minimum backlog = let constants = constants_from_storage_version version in diff --git a/etherlink/kernel_latest/kernel/src/gas_price.rs b/etherlink/kernel_latest/kernel/src/gas_price.rs index 6aaa9550ff560fb4c77b4069e9cb707222e28a61..08a1e466237b1d4d7fdd2982603fa8b7a3d17d9e 100644 --- a/etherlink/kernel_latest/kernel/src/gas_price.rs +++ b/etherlink/kernel_latest/kernel/src/gas_price.rs @@ -11,13 +11,13 @@ use softfloat::F64; use tezos_evm_runtime::runtime::Runtime; use tezos_smart_rollup_encoding::timestamp::Timestamp; -const CAPACITY: u64 = 4_000_000; +const CAPACITY: u64 = 8_000_000; const TARGET: u64 = CAPACITY / 2; const TOLERANCE: u64 = 10 * TARGET; // chosen so that gas price will decrease ~7/8 if there's no usage for ~10 seconds. // ALPHA = -ln(7/8)/(TARGET * 10) -const ALPHA: F64 = softfloat::f64!(0.000_000_007); +const ALPHA: F64 = softfloat::f64!(0.000_000_004); /// Register a completed block into the tick backlog pub fn register_block( diff --git a/etherlink/kernel_latest/kernel/src/migration.rs b/etherlink/kernel_latest/kernel/src/migration.rs index 7b1614ed6dabd1de4477df9ebed40e9125b645e5..b789743ab24996af193b5f16bc8cf354a80e4709 100644 --- a/etherlink/kernel_latest/kernel/src/migration.rs +++ b/etherlink/kernel_latest/kernel/src/migration.rs @@ -372,6 +372,11 @@ fn migrate_to( // validation in the EVM node Ok(MigrationStatus::Done) } + StorageVersion::V36 => { + // Dummy migration allowing the node to decide what gas target to use when trying to + // predict the gas price + Ok(MigrationStatus::Done) + } } } diff --git a/etherlink/kernel_latest/kernel/src/storage.rs b/etherlink/kernel_latest/kernel/src/storage.rs index 90930323d202f6863b3c1315658309aae9325913..bc131c20efbda6a0362cfb563ea3218e3abd0099 100644 --- a/etherlink/kernel_latest/kernel/src/storage.rs +++ b/etherlink/kernel_latest/kernel/src/storage.rs @@ -69,6 +69,7 @@ pub enum StorageVersion { V33, V34, V35, + V36, } impl From for u64 { @@ -83,7 +84,7 @@ impl StorageVersion { } } -pub const STORAGE_VERSION: StorageVersion = StorageVersion::V35; +pub const STORAGE_VERSION: StorageVersion = StorageVersion::V36; pub const PRIVATE_FLAG_PATH: RefPath = RefPath::assert_from(b"/evm/remove_whitelist"); diff --git a/etherlink/kernel_latest/kernel/tests/resources/failed_migration.wasm b/etherlink/kernel_latest/kernel/tests/resources/failed_migration.wasm index c92531a03d327195d37ce5ceaaf70addc886012c..bf90ac13a71469680d83e836af1c9a8c55d13b18 100755 Binary files a/etherlink/kernel_latest/kernel/tests/resources/failed_migration.wasm and b/etherlink/kernel_latest/kernel/tests/resources/failed_migration.wasm differ