diff --git a/SystemConfig.json b/SystemConfig.json index 7a6df9a9f73..73d75b2b0fd 100644 --- a/SystemConfig.json +++ b/SystemConfig.json @@ -18,8 +18,8 @@ "KECCAK_ROUND_COST_GAS": 40, "SHA256_ROUND_COST_GAS": 7, "ECRECOVER_COST_GAS": 7000, - "PRIORITY_TX_MINIMAL_GAS_PRICE": 500000000, + "PRIORITY_TX_MINIMAL_GAS_PRICE": 250000000, "PRIORITY_TX_MAX_GAS_PER_BATCH": 80000000, - "PRIORITY_TX_PUBDATA_PER_BATCH": 100000, + "PRIORITY_TX_PUBDATA_PER_BATCH": 120000, "PRIORITY_TX_BATCH_OVERHEAD_L1_GAS": 1000000 } diff --git a/l1-contracts/contracts/upgrades/Upgrade_v1_4_1.sol b/l1-contracts/contracts/upgrades/Upgrade_v1_4_1.sol new file mode 100644 index 00000000000..d610d5f1c69 --- /dev/null +++ b/l1-contracts/contracts/upgrades/Upgrade_v1_4_1.sol @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: MIT + +pragma solidity 0.8.20; + +import {Diamond} from "../zksync/libraries/Diamond.sol"; +import {BaseZkSyncUpgrade} from "./BaseZkSyncUpgrade.sol"; +import {PubdataPricingMode, FeeParams} from "../zksync/Storage.sol"; + +/// @author Matter Labs +/// @custom:security-contact security@matterlabs.dev +contract Upgrade_v1_4_1 is BaseZkSyncUpgrade { + /// This event is an exact copy of the "IAdmin.NewFeeParams" event. Since they have the same name and parameters, + /// these will be tracked by indexers in the same manner. + event NewFeeParams(FeeParams oldFeeParams, FeeParams newFeeParams); + + /// This function is a copy of the "Admin.changeFeeParams" function. + /// It is to be used once to set the new fee params for the first time as they needed for the correct functioning of the upgrade. + function changeFeeParams(FeeParams memory _newFeeParams) private { + // Double checking that the new fee params are valid, i.e. + // the maximal pubdata per batch is not less than the maximal pubdata per priority transaction. + require(_newFeeParams.maxPubdataPerBatch >= _newFeeParams.priorityTxMaxPubdata, "n6"); + + FeeParams memory oldFeeParams = s.feeParams; + s.feeParams = _newFeeParams; + + emit NewFeeParams(oldFeeParams, _newFeeParams); + } + + /// @notice The main function that will be called by the upgrade proxy. + /// @param _proposedUpgrade The upgrade to be executed. + function upgrade(ProposedUpgrade calldata _proposedUpgrade) public override returns (bytes32) { + // The execution of the next parts of the upgrade does depend on these fee params being already set correctly + changeFeeParams( + FeeParams({ + pubdataPricingMode: PubdataPricingMode.Rollup, + batchOverheadL1Gas: $(PRIORITY_TX_BATCH_OVERHEAD_L1_GAS), + maxPubdataPerBatch: $(PRIORITY_TX_PUBDATA_PER_BATCH), + maxL2GasPerBatch: $(PRIORITY_TX_MAX_GAS_PER_BATCH), + priorityTxMaxPubdata: $(PRIORITY_TX_PUBDATA_PER_BATCH), + minimalL2GasPrice: $(PRIORITY_TX_MINIMAL_GAS_PRICE) + }) + ); + + super.upgrade(_proposedUpgrade); + + return Diamond.DIAMOND_INIT_SUCCESS_RETURN_VALUE; + } +} diff --git a/l1-contracts/contracts/zksync/facets/Admin.sol b/l1-contracts/contracts/zksync/facets/Admin.sol index b9bdaf39e0d..47955b5eb4a 100644 --- a/l1-contracts/contracts/zksync/facets/Admin.sol +++ b/l1-contracts/contracts/zksync/facets/Admin.sol @@ -84,8 +84,7 @@ contract AdminFacet is Base, IAdmin { emit NewPriorityTxMaxGasLimit(oldPriorityTxMaxGasLimit, _newPriorityTxMaxGasLimit); } - /// @notice Change the fee params for L1->L2 transactions - /// @param _newFeeParams The new fee params + /// @inheritdoc IAdmin function changeFeeParams(FeeParams calldata _newFeeParams) external onlyGovernor { // Double checking that the new fee params are valid, i.e. // the maximal pubdata per batch is not less than the maximal pubdata per priority transaction. diff --git a/l1-contracts/contracts/zksync/interfaces/IAdmin.sol b/l1-contracts/contracts/zksync/interfaces/IAdmin.sol index 1b634d469a9..5ed5167a5f0 100644 --- a/l1-contracts/contracts/zksync/interfaces/IAdmin.sol +++ b/l1-contracts/contracts/zksync/interfaces/IAdmin.sol @@ -39,6 +39,10 @@ interface IAdmin is IBase { /// @param _newPriorityTxMaxGasLimit The maximum number of L2 gas that a user can request for L1 -> L2 transactions function setPriorityTxMaxGasLimit(uint256 _newPriorityTxMaxGasLimit) external; + /// @notice Change the fee params for L1->L2 transactions + /// @param _newFeeParams The new fee params + function changeFeeParams(FeeParams calldata _newFeeParams) external; + /// @notice Executes a proposed governor upgrade /// @dev Only the current governor can execute the upgrade /// @param _diamondCut The diamond cut parameters to be executed