mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-04 02:53:45 +00:00
* update fee calculation * add missing GPO slots to trace * add placeholder for contract update logic * nit * update fee calculation * update formula * update GPO slots * update L1GPO bytecode * apply Curie in new worker * move bytecode to config * create an empty block for curie hard fork * initialize L1GasPriceOracle storage slots * add comments * add test * add IsCurie to traces and tests * group GPO storage slots into a struct * update unit test * chore: auto version bump [bot] * trigger ci * update bytecode * remove leading 0x * update comments * include rollup fee tests in CI --------- Co-authored-by: Ömer Faruk Irmak <omerfirmak@gmail.com> Co-authored-by: Thegaram <Thegaram@users.noreply.github.com>
51 lines
7.9 KiB
Go
51 lines
7.9 KiB
Go
package rcfg
|
|
|
|
import (
|
|
"math/big"
|
|
|
|
"github.com/scroll-tech/go-ethereum/common"
|
|
)
|
|
|
|
// TODO:
|
|
// verify in consensus layer when decentralizing sequencer
|
|
|
|
var (
|
|
// L2MessageQueueAddress is the address of the L2MessageQueue
|
|
// predeploy
|
|
// see contracts/src/L2/predeploys/L2MessageQueue.sol
|
|
L2MessageQueueAddress = common.HexToAddress("0x5300000000000000000000000000000000000000")
|
|
WithdrawTrieRootSlot = common.BigToHash(big.NewInt(0))
|
|
|
|
// ScrollFeeVaultAddress is the address of the L2TxFeeVault
|
|
// predeploy
|
|
// see scroll-tech/scroll/contracts/src/L2/predeploys/L2TxFeeVault.sol
|
|
ScrollFeeVaultAddress = common.HexToAddress("0x5300000000000000000000000000000000000005")
|
|
|
|
// L1GasPriceOracleAddress is the address of the L1GasPriceOracle
|
|
// predeploy
|
|
// see scroll-tech/scroll/contracts/src/L2/predeploys/L1GasPriceOracle.sol
|
|
L1GasPriceOracleAddress = common.HexToAddress("0x5300000000000000000000000000000000000002")
|
|
Precision = new(big.Int).SetUint64(1e9)
|
|
L1BaseFeeSlot = common.BigToHash(big.NewInt(1))
|
|
OverheadSlot = common.BigToHash(big.NewInt(2))
|
|
ScalarSlot = common.BigToHash(big.NewInt(3))
|
|
|
|
// New fields added in the Curie hard fork
|
|
L1BlobBaseFeeSlot = common.BigToHash(big.NewInt(5))
|
|
CommitScalarSlot = common.BigToHash(big.NewInt(6))
|
|
BlobScalarSlot = common.BigToHash(big.NewInt(7))
|
|
IsCurieSlot = common.BigToHash(big.NewInt(8))
|
|
|
|
InitialCommitScalar = big.NewInt(230759955285)
|
|
InitialBlobScalar = big.NewInt(417565260)
|
|
|
|
// CurieL1GasPriceOracleBytecode is the new (blob-enabled) gas price oracle after
|
|
// the Curie hard fork. Run these commands in the monorepo to verify this bytecode:
|
|
//
|
|
// git checkout 7059ad0ed465201287e06625dd4058c8ae9682b8
|
|
// cd contracts
|
|
// yarn
|
|
// FOUNDRY_EVM_VERSION="cancun" forge build
|
|
// cat artifacts/src/L1GasPriceOracle.sol/L1GasPriceOracle.json | jq -r .deployedBytecode.object
|
|
CurieL1GasPriceOracleBytecode = common.Hex2Bytes("608060405234801561000f575f80fd5b5060043610610132575f3560e01c8063715018a6116100b4578063a911d77f11610079578063a911d77f1461024c578063bede39b514610254578063de26c4a114610267578063e88a60ad1461027a578063f2fde38b1461028d578063f45e65d8146102a0575f80fd5b8063715018a6146101eb57806384189161146101f35780638da5cb5b146101fc57806393e59dc114610226578063944b247f14610239575f80fd5b80633d0f963e116100fa5780633d0f963e146101a057806349948e0e146101b3578063519b4bd3146101c65780636a5e67e5146101cf57806370465597146101d8575f80fd5b80630c18c1621461013657806313dad5be1461015257806323e524ac1461016f5780633577afc51461017857806339455d3a1461018d575b5f80fd5b61013f60025481565b6040519081526020015b60405180910390f35b60085461015f9060ff1681565b6040519015158152602001610149565b61013f60065481565b61018b6101863660046109c3565b6102a9565b005b61018b61019b3660046109da565b61033b565b61018b6101ae3660046109fa565b610438565b61013f6101c1366004610a3b565b6104bb565b61013f60015481565b61013f60075481565b61018b6101e63660046109c3565b6104e0565b61018b61056e565b61013f60055481565b5f5461020e906001600160a01b031681565b6040516001600160a01b039091168152602001610149565b60045461020e906001600160a01b031681565b61018b6102473660046109c3565b6105a2565b61018b610636565b61018b6102623660046109c3565b610692565b61013f610275366004610a3b565b61074f565b61018b6102883660046109c3565b61076c565b61018b61029b3660046109fa565b610800565b61013f60035481565b5f546001600160a01b031633146102db5760405162461bcd60e51b81526004016102d290610ae6565b60405180910390fd5b621c9c388111156102ff57604051635742c80560e11b815260040160405180910390fd5b60028190556040518181527f32740b35c0ea213650f60d44366b4fb211c9033b50714e4a1d34e65d5beb9bb4906020015b60405180910390a150565b6004805460405163efc7840160e01b815233928101929092526001600160a01b03169063efc7840190602401602060405180830381865afa158015610382573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103a69190610b1d565b6103c3576040516326b3506d60e11b815260040160405180910390fd5b600182905560058190556040518281527f351fb23757bb5ea0546c85b7996ddd7155f96b939ebaa5ff7bc49c75f27f2c449060200160405180910390a16040518181527f9a14bfb5d18c4c3cf14cae19c23d7cf1bcede357ea40ca1f75cd49542c71c214906020015b60405180910390a15050565b5f546001600160a01b031633146104615760405162461bcd60e51b81526004016102d290610ae6565b600480546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527f22d1c35fe072d2e42c3c8f9bd4a0d34aa84a0101d020a62517b33fdb3174e5f7910161042c565b6008545f9060ff16156104d7576104d18261088b565b92915050565b6104d1826108d1565b5f546001600160a01b031633146105095760405162461bcd60e51b81526004016102d290610ae6565b610519633b9aca006103e8610b50565b81111561053957604051631e44fdeb60e11b815260040160405180910390fd5b60038190556040518181527f3336cd9708eaf2769a0f0dc0679f30e80f15dcd88d1921b5a16858e8b85c591a90602001610330565b5f546001600160a01b031633146105975760405162461bcd60e51b81526004016102d290610ae6565b6105a05f610914565b565b5f546001600160a01b031633146105cb5760405162461bcd60e51b81526004016102d290610ae6565b6105e1633b9aca00670de0b6b3a7640000610b50565b8111156106015760405163874f603160e01b815260040160405180910390fd5b60068190556040518181527f2ab3f5a4ebbcbf3c24f62f5454f52f10e1a8c9dcc5acac8f19199ce881a6a10890602001610330565b5f546001600160a01b0316331461065f5760405162461bcd60e51b81526004016102d290610ae6565b60085460ff1615610683576040516379f9c57560e01b815260040160405180910390fd5b6008805460ff19166001179055565b6004805460405163efc7840160e01b815233928101929092526001600160a01b03169063efc7840190602401602060405180830381865afa1580156106d9573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106fd9190610b1d565b61071a576040516326b3506d60e11b815260040160405180910390fd5b60018190556040518181527f351fb23757bb5ea0546c85b7996ddd7155f96b939ebaa5ff7bc49c75f27f2c4490602001610330565b6008545f9060ff161561076357505f919050565b6104d182610963565b5f546001600160a01b031633146107955760405162461bcd60e51b81526004016102d290610ae6565b6107ab633b9aca00670de0b6b3a7640000610b50565b8111156107cb5760405163f37ec21560e01b815260040160405180910390fd5b60078190556040518181527f6b332a036d8c3ead57dcb06c87243bd7a2aed015ddf2d0528c2501dae56331aa90602001610330565b5f546001600160a01b031633146108295760405162461bcd60e51b81526004016102d290610ae6565b6001600160a01b03811661087f5760405162461bcd60e51b815260206004820152601d60248201527f6e6577206f776e657220697320746865207a65726f206164647265737300000060448201526064016102d2565b61088881610914565b50565b5f633b9aca0060055483516007546108a39190610b50565b6108ad9190610b50565b6001546006546108bd9190610b50565b6108c79190610b67565b6104d19190610b7a565b5f806108dc83610963565b90505f600154826108ed9190610b50565b9050633b9aca00600354826109029190610b50565b61090c9190610b7a565b949350505050565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80515f908190815b818110156109b45784818151811061098557610985610b99565b01602001516001600160f81b0319165f036109a5576004830192506109ac565b6010830192505b60010161096b565b50506002540160400192915050565b5f602082840312156109d3575f80fd5b5035919050565b5f80604083850312156109eb575f80fd5b50508035926020909101359150565b5f60208284031215610a0a575f80fd5b81356001600160a01b0381168114610a20575f80fd5b9392505050565b634e487b7160e01b5f52604160045260245ffd5b5f60208284031215610a4b575f80fd5b813567ffffffffffffffff80821115610a62575f80fd5b818401915084601f830112610a75575f80fd5b813581811115610a8757610a87610a27565b604051601f8201601f19908116603f01168101908382118183101715610aaf57610aaf610a27565b81604052828152876020848701011115610ac7575f80fd5b826020860160208301375f928101602001929092525095945050505050565b60208082526017908201527f63616c6c6572206973206e6f7420746865206f776e6572000000000000000000604082015260600190565b5f60208284031215610b2d575f80fd5b81518015158114610a20575f80fd5b634e487b7160e01b5f52601160045260245ffd5b80820281158282048414176104d1576104d1610b3c565b808201808211156104d1576104d1610b3c565b5f82610b9457634e487b7160e01b5f52601260045260245ffd5b500490565b634e487b7160e01b5f52603260045260245ffdfea26469706673582212206579d545ea4839464c2fd4ba9a7e6a4f4fee1cc1b51182da675c0f0c05fc161964736f6c63430008180033")
|
|
)
|