diff --git a/packages/protocol/contracts/L1/TaikoData.sol b/packages/protocol/contracts/L1/TaikoData.sol index a95b0edaca..a2aa5db8c4 100644 --- a/packages/protocol/contracts/L1/TaikoData.sol +++ b/packages/protocol/contracts/L1/TaikoData.sol @@ -24,7 +24,7 @@ library TaikoData { uint256 maxBytesPerTxList; uint256 minTxGasLimit; uint256 anchorTxGasLimit; - uint256 feePremiumLamda; + uint256 slotSmoothingFactor; uint256 rewardBurnBips; uint256 proposerDepositPctg; // Moving average factors diff --git a/packages/protocol/contracts/L1/libs/LibUtils.sol b/packages/protocol/contracts/L1/libs/LibUtils.sol index bd4e0d6722..0c02da4edc 100644 --- a/packages/protocol/contracts/L1/libs/LibUtils.sol +++ b/packages/protocol/contracts/L1/libs/LibUtils.sol @@ -124,12 +124,14 @@ library LibUtils { uint256 feeBase ) internal view returns (uint256) { // m is the `n'` in the whitepaper - uint256 m = config.maxNumBlocks - 1 + config.feePremiumLamda; + uint256 m = 1000 * + (config.maxNumBlocks - 1) + + config.slotSmoothingFactor; // n is the number of unverified blocks - uint256 n = state.nextBlockId - state.latestVerifiedId - 1; + uint256 n = 1000 * (state.nextBlockId - state.latestVerifiedId - 1); // k is `m − n + 1` or `m − n - 1`in the whitepaper - uint256 k = isProposal ? m - n - 1 : m - n + 1; - return (feeBase * (m - 1) * m) / (m - n) / k; + uint256 k = isProposal ? m - n - 1000 : m - n + 1000; + return (feeBase * (m - 1000) * m) / (m - n) / k; } // Implement "Bootstrap Discount Multipliers", see the whitepaper. diff --git a/packages/protocol/contracts/libs/LibSharedConfig.sol b/packages/protocol/contracts/libs/LibSharedConfig.sol index fefbc3d8fa..1a38a3dac2 100644 --- a/packages/protocol/contracts/libs/LibSharedConfig.sol +++ b/packages/protocol/contracts/libs/LibSharedConfig.sol @@ -27,7 +27,7 @@ library LibSharedConfig { maxBytesPerTxList: 10240, // TODO minTxGasLimit: 21000, // TODO anchorTxGasLimit: 250000, - feePremiumLamda: 590, + slotSmoothingFactor: 590000, rewardBurnBips: 100, // 100 basis points or 1% proposerDepositPctg: 25, // 25% // Moving average factors diff --git a/packages/protocol/contracts/test/L1/TestTaikoL1.sol b/packages/protocol/contracts/test/L1/TestTaikoL1.sol index 86921b823a..c6b28ef0c0 100644 --- a/packages/protocol/contracts/test/L1/TestTaikoL1.sol +++ b/packages/protocol/contracts/test/L1/TestTaikoL1.sol @@ -31,7 +31,7 @@ contract TestTaikoL1 is TaikoL1, IProofVerifier { config.maxBytesPerTxList = 10240; // TODO config.minTxGasLimit = 21000; // TODO config.anchorTxGasLimit = 250000; - config.feePremiumLamda = 590; + config.slotSmoothingFactor = 590000; config.rewardBurnBips = 100; // 100 basis points or 1% config.proposerDepositPctg = 25; // 25% diff --git a/packages/protocol/contracts/test/L1/TestTaikoL1EnableTokenomics.sol b/packages/protocol/contracts/test/L1/TestTaikoL1EnableTokenomics.sol index 1aca5730f3..6a593e7b4f 100644 --- a/packages/protocol/contracts/test/L1/TestTaikoL1EnableTokenomics.sol +++ b/packages/protocol/contracts/test/L1/TestTaikoL1EnableTokenomics.sol @@ -31,7 +31,7 @@ contract TestTaikoL1EnableTokenomics is TaikoL1, IProofVerifier { config.maxBytesPerTxList = 10240; // TODO config.minTxGasLimit = 21000; // TODO config.anchorTxGasLimit = 250000; - config.feePremiumLamda = 590; + config.slotSmoothingFactor = 590000; config.rewardBurnBips = 100; // 100 basis points or 1% config.proposerDepositPctg = 25; // 25% diff --git a/packages/protocol/contracts/test/L1/TestTaikoL2.sol b/packages/protocol/contracts/test/L1/TestTaikoL2.sol index 2904fbb95a..91642bbe58 100644 --- a/packages/protocol/contracts/test/L1/TestTaikoL2.sol +++ b/packages/protocol/contracts/test/L1/TestTaikoL2.sol @@ -32,7 +32,7 @@ contract TestTaikoL2 is TaikoL2 { config.maxBytesPerTxList = 10240; // TODO config.minTxGasLimit = 21000; // TODO config.anchorTxGasLimit = 250000; - config.feePremiumLamda = 590; + config.slotSmoothingFactor = 590000; config.rewardBurnBips = 100; // 100 basis points or 1% config.proposerDepositPctg = 25; // 25% diff --git a/packages/protocol/contracts/test/L1/TestTaikoL2EnablePublicInputsCheck.sol b/packages/protocol/contracts/test/L1/TestTaikoL2EnablePublicInputsCheck.sol index e5f4affec4..dc5ff33b5f 100644 --- a/packages/protocol/contracts/test/L1/TestTaikoL2EnablePublicInputsCheck.sol +++ b/packages/protocol/contracts/test/L1/TestTaikoL2EnablePublicInputsCheck.sol @@ -32,7 +32,7 @@ contract TestTaikoL2EnablePublicInputsCheck is TaikoL2 { config.maxBytesPerTxList = 10240; // TODO config.minTxGasLimit = 21000; // TODO config.anchorTxGasLimit = 250000; - config.feePremiumLamda = 590; + config.slotSmoothingFactor = 590000; config.rewardBurnBips = 100; // 100 basis points or 1% config.proposerDepositPctg = 25; // 25%