From 5372673cbc825330a9a9d2b0285a973161fdd34e Mon Sep 17 00:00:00 2001 From: Michael de Hoog Date: Thu, 14 Dec 2023 15:17:45 -1000 Subject: [PATCH 01/14] Add FastLZ for better L1Cost estimation Co-authored-by: Michael de Hoog Co-authored-by: Danyal Prout Co-authored-by: Yukai Tu Co-authored-by: angel-ding-cb --- go.mod | 4 +- go.sum | 8 +- op-bindings/bindings/gaspriceoracle.go | 87 +++++++++- op-chain-ops/cmd/ecotone-scalar/main.go | 2 +- op-chain-ops/genesis/config.go | 2 +- op-e2e/actions/fjord_fork_test.go | 161 ++++++++++++++++++ op-e2e/actions/l2_sequencer.go | 7 + op-e2e/gas_price_oracle_test.go | 135 +++++++++++++++ op-node/chaincfg/chains_test.go | 5 +- op-node/rollup/derive/attributes.go | 8 + .../derive/fjord_upgrade_transactions.go | 88 ++++++++++ .../derive/fjord_upgrade_transactions_test.go | 62 +++++++ op-node/rollup/derive/l1_block_info.go | 1 + op-node/rollup/derive/system_config.go | 10 +- op-node/rollup/driver/sequencer.go | 6 + op-node/rollup/types.go | 8 + op-service/eth/types.go | 82 +++++++-- op-service/eth/types_test.go | 2 +- 18 files changed, 653 insertions(+), 25 deletions(-) create mode 100644 op-e2e/actions/fjord_fork_test.go create mode 100644 op-e2e/gas_price_oracle_test.go create mode 100644 op-node/rollup/derive/fjord_upgrade_transactions.go create mode 100644 op-node/rollup/derive/fjord_upgrade_transactions_test.go diff --git a/go.mod b/go.mod index 8975e5fa90e..538a43626c7 100644 --- a/go.mod +++ b/go.mod @@ -47,10 +47,10 @@ require ( github.com/prometheus/client_golang v1.19.0 github.com/stretchr/testify v1.9.0 github.com/urfave/cli/v2 v2.27.1 - golang.org/x/crypto v0.23.0 + golang.org/x/crypto v0.21.0 golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 golang.org/x/sync v0.6.0 - golang.org/x/term v0.20.0 + golang.org/x/term v0.18.0 golang.org/x/time v0.5.0 gorm.io/driver/postgres v1.5.7 gorm.io/gorm v1.25.10 diff --git a/go.sum b/go.sum index 267bdb13b0c..f8151ce32a2 100644 --- a/go.sum +++ b/go.sum @@ -868,8 +868,8 @@ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= -golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 h1:hNQpMuAJe5CtcUqCXaWga3FHu+kQvCqcsoVaQgSV60o= golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= @@ -999,8 +999,8 @@ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuX golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= -golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= +golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= diff --git a/op-bindings/bindings/gaspriceoracle.go b/op-bindings/bindings/gaspriceoracle.go index 7636a7c2f10..52dbc2e810c 100644 --- a/op-bindings/bindings/gaspriceoracle.go +++ b/op-bindings/bindings/gaspriceoracle.go @@ -30,8 +30,8 @@ var ( // GasPriceOracleMetaData contains all meta data concerning the GasPriceOracle contract. var GasPriceOracleMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"function\",\"name\":\"DECIMALS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"baseFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"baseFeeScalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blobBaseFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blobBaseFeeScalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decimals\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"gasPrice\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getL1Fee\",\"inputs\":[{\"name\":\"_data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getL1GasUsed\",\"inputs\":[{\"name\":\"_data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isEcotone\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"l1BaseFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"overhead\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"scalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setEcotone\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"}]", - Bin: "0x608060405234801561001057600080fd5b50610fb5806100206000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806354fd4d5011610097578063de26c4a111610066578063de26c4a1146101da578063f45e65d8146101ed578063f8206140146101f5578063fe173b97146101cc57600080fd5b806354fd4d501461016657806368d5dca6146101af5780636ef25c3a146101cc578063c5985918146101d257600080fd5b8063313ce567116100d3578063313ce5671461012757806349948e0e1461012e5780634ef6e22414610141578063519b4bd31461015e57600080fd5b80630c18c162146100fa57806322b90ab3146101155780632e0f26251461011f575b600080fd5b6101026101fd565b6040519081526020015b60405180910390f35b61011d61031e565b005b610102600681565b6006610102565b61010261013c366004610b73565b610541565b60005461014e9060ff1681565b604051901515815260200161010c565b610102610565565b6101a26040518060400160405280600581526020017f312e322e3000000000000000000000000000000000000000000000000000000081525081565b60405161010c9190610c42565b6101b76105c6565b60405163ffffffff909116815260200161010c565b48610102565b6101b761064b565b6101026101e8366004610b73565b6106ac565b610102610760565b610102610853565b6000805460ff1615610296576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f47617350726963654f7261636c653a206f76657268656164282920697320646560448201527f707265636174656400000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa1580156102f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103199190610cb5565b905090565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa15801561037d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a19190610cce565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610481576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e2073657420697345636f746f6e6520666c6160648201527f6700000000000000000000000000000000000000000000000000000000000000608482015260a40161028d565b60005460ff1615610514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a2045636f746f6e6520616c72656164792060448201527f6163746976650000000000000000000000000000000000000000000000000000606482015260840161028d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b6000805460ff161561055c57610556826108b4565b92915050565b61055682610958565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa1580156102f5573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610627573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103199190610d04565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610627573d6000803e3d6000fd5b6000806106b883610ab4565b60005490915060ff16156106cc5792915050565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa15801561072b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074f9190610cb5565b6107599082610d59565b9392505050565b6000805460ff16156107f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a207363616c61722829206973206465707260448201527f6563617465640000000000000000000000000000000000000000000000000000606482015260840161028d565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa1580156102f5573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa1580156102f5573d6000803e3d6000fd5b6000806108c083610ab4565b905060006108cc610565565b6108d461064b565b6108df906010610d71565b63ffffffff166108ef9190610d9d565b905060006108fb610853565b6109036105c6565b63ffffffff166109139190610d9d565b905060006109218284610d59565b61092b9085610d9d565b90506109396006600a610efa565b610944906010610d9d565b61094e9082610f06565b9695505050505050565b60008061096483610ab4565b9050600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109eb9190610cb5565b6109f3610565565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a769190610cb5565b610a809085610d59565b610a8a9190610d9d565b610a949190610d9d565b9050610aa26006600a610efa565b610aac9082610f06565b949350505050565b80516000908190815b81811015610b3757848181518110610ad757610ad7610f41565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016600003610b1757610b10600484610d59565b9250610b25565b610b22601084610d59565b92505b80610b2f81610f70565b915050610abd565b50610aac82610440610d59565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600060208284031215610b8557600080fd5b813567ffffffffffffffff80821115610b9d57600080fd5b818401915084601f830112610bb157600080fd5b813581811115610bc357610bc3610b44565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715610c0957610c09610b44565b81604052828152876020848701011115610c2257600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b81811015610c6f57858101830151858201604001528201610c53565b81811115610c81576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b600060208284031215610cc757600080fd5b5051919050565b600060208284031215610ce057600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461075957600080fd5b600060208284031215610d1657600080fd5b815163ffffffff8116811461075957600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115610d6c57610d6c610d2a565b500190565b600063ffffffff80831681851681830481118215151615610d9457610d94610d2a565b02949350505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610dd557610dd5610d2a565b500290565b600181815b80851115610e3357817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610e1957610e19610d2a565b80851615610e2657918102915b93841c9390800290610ddf565b509250929050565b600082610e4a57506001610556565b81610e5757506000610556565b8160018114610e6d5760028114610e7757610e93565b6001915050610556565b60ff841115610e8857610e88610d2a565b50506001821b610556565b5060208310610133831016604e8410600b8410161715610eb6575081810a610556565b610ec08383610dda565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610ef257610ef2610d2a565b029392505050565b60006107598383610e3b565b600082610f3c577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610fa157610fa1610d2a565b506001019056fea164736f6c634300080f000a", + ABI: "[{\"type\":\"function\",\"name\":\"DECIMALS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"baseFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"baseFeeScalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blobBaseFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blobBaseFeeScalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decimals\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"gasPrice\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getL1Fee\",\"inputs\":[{\"name\":\"_data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getL1FeeUpperBound\",\"inputs\":[{\"name\":\"_unsignedTxSize\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getL1GasUsed\",\"inputs\":[{\"name\":\"_data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isEcotone\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isFjord\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"l1BaseFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"overhead\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"scalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setEcotone\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setFjord\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"}]", + Bin: "0x608060405234801561001057600080fd5b50611928806100206000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80636ef25c3a116100b2578063de26c4a111610081578063f45e65d811610066578063f45e65d81461025b578063f820614014610263578063fe173b971461020d57600080fd5b8063de26c4a114610235578063f1c7a58b1461024857600080fd5b80636ef25c3a1461020d5780638e98b10614610213578063960e3a231461021b578063c59859181461022d57600080fd5b806349948e0e11610109578063519b4bd3116100ee578063519b4bd31461019f57806354fd4d50146101a757806368d5dca6146101f057600080fd5b806349948e0e1461016f5780634ef6e2241461018257600080fd5b80630c18c1621461013b57806322b90ab3146101565780632e0f262514610160578063313ce56714610168575b600080fd5b61014361026b565b6040519081526020015b60405180910390f35b61015e61038c565b005b610143600681565b6006610143565b61014361017d36600461132d565b6105af565b60005461018f9060ff1681565b604051901515815260200161014d565b6101436105ec565b6101e36040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b60405161014d91906113fc565b6101f861064d565b60405163ffffffff909116815260200161014d565b48610143565b61015e6106d2565b60005461018f90610100900460ff1681565b6101f86108d4565b61014361024336600461132d565b610935565b61014361025636600461146f565b6109e9565b610143610ad1565b610143610bc4565b6000805460ff1615610304576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f47617350726963654f7261636c653a206f76657268656164282920697320646560448201527f707265636174656400000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611488565b905090565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040f91906114a1565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e2073657420697345636f746f6e6520666c6160648201527f6700000000000000000000000000000000000000000000000000000000000000608482015260a4016102fb565b60005460ff1615610582576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a2045636f746f6e6520616c72656164792060448201527f616374697665000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60008054610100900460ff16156105cf576105c982610c25565b92915050565b60005460ff16156105e3576105c982610c4f565b6105c982610cf3565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106ae573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038791906114d7565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa158015610731573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075591906114a1565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461080f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e20736574206973466a6f726420666c61670060648201526084016102fb565b600054610100900460ff16156108a6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f47617350726963654f7261636c653a20466a6f726420616c726561647920616360448201527f746976650000000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106ae573d6000803e3d6000fd5b60008061094183610e47565b60005490915060ff16156109555792915050565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d89190611488565b6109e2908261152c565b9392505050565b60008054610100900460ff16610a81576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f47617350726963654f7261636c653a206765744c314665655570706572426f7560448201527f6e64206f6e6c7920737570706f72747320466a6f72640000000000000000000060648201526084016102fb565b6000610a8e60ff84611573565b610a9890846115db565b610aa39060106115db565b610aae9060446115db565b90506000610abd8460446115db565b9050610ac98282610ed7565b949350505050565b6000805460ff1615610b65576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a207363616c61722829206973206465707260448201527f656361746564000000000000000000000000000000000000000000000000000060648201526084016102fb565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600080610c3183610fe1565b51610c3d90604461152c565b9050600083516044610abd919061152c565b600080610c5b83610e47565b90506000610c676105ec565b610c6f6108d4565b610c7a90601061164f565b63ffffffff16610c8a919061167b565b90506000610c96610bc4565b610c9e61064d565b63ffffffff16610cae919061167b565b90506000610cbc828461152c565b610cc6908561167b565b9050610cd46006600a6117d8565b610cdf90601061167b565b610ce990826117e4565b9695505050505050565b600080610cff83610e47565b9050600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d869190611488565b610d8e6105ec565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ded573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e119190611488565b610e1b908561152c565b610e25919061167b565b610e2f919061167b565b9050610e3d6006600a6117d8565b610ac990826117e4565b80516000908190815b81811015610eca57848181518110610e6a57610e6a6117f8565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016600003610eaa57610ea360048461152c565b9250610eb8565b610eb560108461152c565b92505b80610ec281611827565b915050610e50565b50610ac98261044061152c565b600080610ee2610bc4565b610eea61064d565b63ffffffff16610efa919061167b565b610f026105ec565b610f0a6108d4565b610f1590601061164f565b63ffffffff16610f25919061167b565b610f2f919061152c565b90506000610f5d847ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffea5a861185f565b610f6a86620fbd2661185f565b610f94907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe5f19de6115db565b610f9e91906115db565b90506000811215610fad575060005b610fb96006600261167b565b610fc490600a6117d8565b610fce838361167b565b610fd891906117e4565b95945050505050565b6060611170565b818153600101919050565b600082840393505b838110156109e25782810151828201511860001a1590930292600101610ffb565b825b60208210611068578251611033601f83610fe8565b52602092909201917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09091019060210161101e565b81156109e257825161107d6001840383610fe8565b520160010192915050565b60006001830392505b61010782106110c9576110bb8360ff166110b660fd6110b68760081c60e00189610fe8565b610fe8565b935061010682039150611091565b600782106110f6576110ef8360ff166110b6600785036110b68760081c60e00189610fe8565b90506109e2565b610ac98360ff166110b68560081c8560051b0187610fe8565b61116882820361114c61113c84600081518060001a8160011a60081b178160021a60101b17915050919050565b639e3779b90260131c611fff1690565b8060021b6040510182815160e01c1860e01b8151188152505050565b600101919050565b6180003860405139618000604051016020830180600d8551820103826002015b818110156112a3576000805b50508051604051600082901a600183901a60081b1760029290921a60101b91909117639e3779b9810260111c617ffc16909101805160e081811c878603811890911b909118909152840190818303908484106111f85750611233565b600184019350611fff821161122d578251600081901a600182901a60081b1760029190911a60101b17810361122d5750611233565b5061119c565b8383106112415750506112a3565b6001830392508583111561125f5761125c878788860361101c565b96505b611273600985016003850160038501610ff3565b9150611280878284611088565b965050611298846112938684860161110f565b61110f565b915050809350611190565b50506112b5838384885185010361101c565b925050506040519150618000820180820391508183526020830160005b838110156112ea5782810151828201526020016112d2565b506000920191825250602001604052919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561133f57600080fd5b813567ffffffffffffffff8082111561135757600080fd5b818401915084601f83011261136b57600080fd5b81358181111561137d5761137d6112fe565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156113c3576113c36112fe565b816040528281528760208487010111156113dc57600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b818110156114295785810183015185820160400152820161140d565b8181111561143b576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60006020828403121561148157600080fd5b5035919050565b60006020828403121561149a57600080fd5b5051919050565b6000602082840312156114b357600080fd5b815173ffffffffffffffffffffffffffffffffffffffff811681146109e257600080fd5b6000602082840312156114e957600080fd5b815163ffffffff811681146109e257600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561153f5761153f6114fd565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261158257611582611544565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f8000000000000000000000000000000000000000000000000000000000000000831416156115d6576115d66114fd565b500590565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03841381151615611615576116156114fd565b827f8000000000000000000000000000000000000000000000000000000000000000038412811615611649576116496114fd565b50500190565b600063ffffffff80831681851681830481118215151615611672576116726114fd565b02949350505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156116b3576116b36114fd565b500290565b600181815b8085111561171157817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156116f7576116f76114fd565b8085161561170457918102915b93841c93908002906116bd565b509250929050565b600082611728575060016105c9565b81611735575060006105c9565b816001811461174b576002811461175557611771565b60019150506105c9565b60ff841115611766576117666114fd565b50506001821b6105c9565b5060208310610133831016604e8410600b8410161715611794575081810a6105c9565b61179e83836116b8565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156117d0576117d06114fd565b029392505050565b60006109e28383611719565b6000826117f3576117f3611544565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611858576118586114fd565b5060010190565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000841360008413858304851182821616156118a0576118a06114fd565b7f800000000000000000000000000000000000000000000000000000000000000060008712868205881281841616156118db576118db6114fd565b600087129250878205871284841616156118f7576118f76114fd565b8785058712818416161561190d5761190d6114fd565b50505092909302939250505056fea164736f6c634300080f000a", } // GasPriceOracleABI is the input ABI used to generate the binding from. @@ -449,6 +449,37 @@ func (_GasPriceOracle *GasPriceOracleCallerSession) GetL1Fee(_data []byte) (*big return _GasPriceOracle.Contract.GetL1Fee(&_GasPriceOracle.CallOpts, _data) } +// GetL1FeeUpperBound is a free data retrieval call binding the contract method 0xf1c7a58b. +// +// Solidity: function getL1FeeUpperBound(uint256 _unsignedTxSize) view returns(uint256) +func (_GasPriceOracle *GasPriceOracleCaller) GetL1FeeUpperBound(opts *bind.CallOpts, _unsignedTxSize *big.Int) (*big.Int, error) { + var out []interface{} + err := _GasPriceOracle.contract.Call(opts, &out, "getL1FeeUpperBound", _unsignedTxSize) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetL1FeeUpperBound is a free data retrieval call binding the contract method 0xf1c7a58b. +// +// Solidity: function getL1FeeUpperBound(uint256 _unsignedTxSize) view returns(uint256) +func (_GasPriceOracle *GasPriceOracleSession) GetL1FeeUpperBound(_unsignedTxSize *big.Int) (*big.Int, error) { + return _GasPriceOracle.Contract.GetL1FeeUpperBound(&_GasPriceOracle.CallOpts, _unsignedTxSize) +} + +// GetL1FeeUpperBound is a free data retrieval call binding the contract method 0xf1c7a58b. +// +// Solidity: function getL1FeeUpperBound(uint256 _unsignedTxSize) view returns(uint256) +func (_GasPriceOracle *GasPriceOracleCallerSession) GetL1FeeUpperBound(_unsignedTxSize *big.Int) (*big.Int, error) { + return _GasPriceOracle.Contract.GetL1FeeUpperBound(&_GasPriceOracle.CallOpts, _unsignedTxSize) +} + // GetL1GasUsed is a free data retrieval call binding the contract method 0xde26c4a1. // // Solidity: function getL1GasUsed(bytes _data) view returns(uint256) @@ -511,6 +542,37 @@ func (_GasPriceOracle *GasPriceOracleCallerSession) IsEcotone() (bool, error) { return _GasPriceOracle.Contract.IsEcotone(&_GasPriceOracle.CallOpts) } +// IsFjord is a free data retrieval call binding the contract method 0x960e3a23. +// +// Solidity: function isFjord() view returns(bool) +func (_GasPriceOracle *GasPriceOracleCaller) IsFjord(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _GasPriceOracle.contract.Call(opts, &out, "isFjord") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsFjord is a free data retrieval call binding the contract method 0x960e3a23. +// +// Solidity: function isFjord() view returns(bool) +func (_GasPriceOracle *GasPriceOracleSession) IsFjord() (bool, error) { + return _GasPriceOracle.Contract.IsFjord(&_GasPriceOracle.CallOpts) +} + +// IsFjord is a free data retrieval call binding the contract method 0x960e3a23. +// +// Solidity: function isFjord() view returns(bool) +func (_GasPriceOracle *GasPriceOracleCallerSession) IsFjord() (bool, error) { + return _GasPriceOracle.Contract.IsFjord(&_GasPriceOracle.CallOpts) +} + // L1BaseFee is a free data retrieval call binding the contract method 0x519b4bd3. // // Solidity: function l1BaseFee() view returns(uint256) @@ -655,3 +717,24 @@ func (_GasPriceOracle *GasPriceOracleSession) SetEcotone() (*types.Transaction, func (_GasPriceOracle *GasPriceOracleTransactorSession) SetEcotone() (*types.Transaction, error) { return _GasPriceOracle.Contract.SetEcotone(&_GasPriceOracle.TransactOpts) } + +// SetFjord is a paid mutator transaction binding the contract method 0x8e98b106. +// +// Solidity: function setFjord() returns() +func (_GasPriceOracle *GasPriceOracleTransactor) SetFjord(opts *bind.TransactOpts) (*types.Transaction, error) { + return _GasPriceOracle.contract.Transact(opts, "setFjord") +} + +// SetFjord is a paid mutator transaction binding the contract method 0x8e98b106. +// +// Solidity: function setFjord() returns() +func (_GasPriceOracle *GasPriceOracleSession) SetFjord() (*types.Transaction, error) { + return _GasPriceOracle.Contract.SetFjord(&_GasPriceOracle.TransactOpts) +} + +// SetFjord is a paid mutator transaction binding the contract method 0x8e98b106. +// +// Solidity: function setFjord() returns() +func (_GasPriceOracle *GasPriceOracleTransactorSession) SetFjord() (*types.Transaction, error) { + return _GasPriceOracle.Contract.SetFjord(&_GasPriceOracle.TransactOpts) +} diff --git a/op-chain-ops/cmd/ecotone-scalar/main.go b/op-chain-ops/cmd/ecotone-scalar/main.go index ad75ba87f5b..e116d15bf8b 100644 --- a/op-chain-ops/cmd/ecotone-scalar/main.go +++ b/op-chain-ops/cmd/ecotone-scalar/main.go @@ -59,7 +59,7 @@ func main() { scalar = uint(decoded.BaseFeeScalar) blobScalar = uint(decoded.BlobBaseFeeScalar) } else { - encoded = eth.EncodeScalar(eth.EcostoneScalars{ + encoded = eth.EncodeScalar(eth.EcotoneScalars{ BlobBaseFeeScalar: uint32(blobScalar), BaseFeeScalar: uint32(scalar), }) diff --git a/op-chain-ops/genesis/config.go b/op-chain-ops/genesis/config.go index 369bc54dace..afdf5839124 100644 --- a/op-chain-ops/genesis/config.go +++ b/op-chain-ops/genesis/config.go @@ -493,7 +493,7 @@ func (d *DeployConfig) FeeScalar() [32]byte { if d.GasPriceOracleScalar != 0 { return common.BigToHash(big.NewInt(int64(d.GasPriceOracleScalar))) } - return eth.EncodeScalar(eth.EcostoneScalars{ + return eth.EncodeScalar(eth.EcotoneScalars{ BlobBaseFeeScalar: d.GasPriceOracleBlobBaseFeeScalar, BaseFeeScalar: d.GasPriceOracleBaseFeeScalar, }) diff --git a/op-e2e/actions/fjord_fork_test.go b/op-e2e/actions/fjord_fork_test.go new file mode 100644 index 00000000000..2cb104754cb --- /dev/null +++ b/op-e2e/actions/fjord_fork_test.go @@ -0,0 +1,161 @@ +package actions + +import ( + "context" + "encoding/hex" + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/stretchr/testify/require" + + "github.com/ethereum-optimism/optimism/op-bindings/bindings" + "github.com/ethereum-optimism/optimism/op-bindings/predeploys" + "github.com/ethereum-optimism/optimism/op-chain-ops/genesis" + "github.com/ethereum-optimism/optimism/op-e2e/e2eutils" + "github.com/ethereum-optimism/optimism/op-node/rollup/derive" + "github.com/ethereum-optimism/optimism/op-service/testlog" +) + +var ( + fjordGasPriceOracleCodeHash = common.HexToHash("0x56d6f6aae2e5b1ed447f2094f5ba59b79404a8ccefcac4778dc4bba085bd7733") + // https://basescan.org/tx/0x8debb2fe54200183fb8baa3c6dbd8e6ec2e4f7a4add87416cd60336b8326d16a + txHex = "02f875822105819b8405709fb884057d460082e97f94273ca93a52b817294830ed7572aa591ccfa647fd80881249c58b0021fb3fc080a05bb08ccfd68f83392e446dac64d88a2d28e7072c06502dfabc4a77e77b5c7913a05878d53dd4ebba4f6367e572d524dffcabeec3abb1d8725ee3ac5dc32e1852e3" + + costTxSizeCoef int64 = -88_664 + costFastlzCoef int64 = 1_031_462 + costIntercept int64 = -27_321_890 +) + +func TestFjordNetworkUpgradeTransactions(gt *testing.T) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + genesisBlock := hexutil.Uint64(0) + fjordOffset := hexutil.Uint64(2) + + dp.DeployConfig.L1CancunTimeOffset = &genesisBlock // can be removed once Cancun on L1 is the default + + // Activate all forks at genesis, and schedule Fjord the block after + dp.DeployConfig.L2GenesisRegolithTimeOffset = &genesisBlock + dp.DeployConfig.L2GenesisCanyonTimeOffset = &genesisBlock + dp.DeployConfig.L2GenesisDeltaTimeOffset = &genesisBlock + dp.DeployConfig.L2GenesisEcotoneTimeOffset = &genesisBlock + dp.DeployConfig.L2GenesisFjordTimeOffset = &fjordOffset + + require.NoError(t, dp.DeployConfig.Check(), "must have valid config") + + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LvlDebug) + _, _, _, sequencer, engine, verifier, _, _ := setupReorgTestActors(t, dp, sd, log) + ethCl := engine.EthClient() + + // start op-nodes + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // Get current implementations addresses (by slot) for L1Block + GasPriceOracle + initialGasPriceOracleAddress, err := ethCl.StorageAt(context.Background(), predeploys.GasPriceOracleAddr, genesis.ImplementationSlot, nil) + require.NoError(t, err) + + // Build to the Fjord block + sequencer.ActBuildL2ToFjord(t) + + // get latest block + latestBlock, err := ethCl.BlockByNumber(context.Background(), nil) + require.NoError(t, err) + require.Equal(t, sequencer.L2Unsafe().Number, latestBlock.Number().Uint64()) + + transactions := latestBlock.Transactions() + // L1Block: 1 set-L1-info + 1 deploys + 1 upgradeTo + 1 enable fjord on GPO + // See [derive.FjordNetworkUpgradeTransactions] + require.Equal(t, 4, len(transactions)) + + // All transactions are successful + for i := 1; i < 4; i++ { + txn := transactions[i] + receipt, err := ethCl.TransactionReceipt(context.Background(), txn.Hash()) + require.NoError(t, err) + require.Equal(t, types.ReceiptStatusSuccessful, receipt.Status) + require.NotEmpty(t, txn.Data(), "upgrade tx must provide input data") + } + + expectedGasPriceOracleAddress := crypto.CreateAddress(derive.GasPriceOracleFjordDeployerAddress, 0) + + // Gas Price Oracle Proxy is updated + updatedGasPriceOracleAddress, err := ethCl.StorageAt(context.Background(), predeploys.GasPriceOracleAddr, genesis.ImplementationSlot, latestBlock.Number()) + require.NoError(t, err) + require.Equal(t, expectedGasPriceOracleAddress, common.BytesToAddress(updatedGasPriceOracleAddress)) + require.NotEqualf(t, initialGasPriceOracleAddress, updatedGasPriceOracleAddress, "Gas Price Oracle Proxy address should have changed") + verifyCodeHashMatches(t, ethCl, expectedGasPriceOracleAddress, fjordGasPriceOracleCodeHash) + + // Get gas price from oracle + gasPriceOracle, err := bindings.NewGasPriceOracleCaller(predeploys.GasPriceOracleAddr, ethCl) + require.NoError(t, err) + + // Check that Fjord was activated + isFjord, err := gasPriceOracle.IsFjord(nil) + require.NoError(t, err) + require.True(t, isFjord) + + // Check GetL1Fee is updated + txData, err := hex.DecodeString(txHex) + require.NoError(t, err) + + used, err := gasPriceOracle.GetL1Fee(&bind.CallOpts{}, txData) + require.NoError(t, err) + + fastLzLength := types.FlzCompressLen(txData) + + cost := fjordL1Cost(t, gasPriceOracle, int64(fastLzLength), int64(len(txData))) + + require.Equal(t, cost.Uint64(), used.Uint64()) + + // Check that L1FeeUppberBound works + upperBound, err := gasPriceOracle.GetL1FeeUpperBound(&bind.CallOpts{}, big.NewInt(int64(len(txData)))) + require.NoError(t, err) + + flzUpperBound := len(txData) + len(txData)/255 + 16 + + upperBoundCost := fjordL1Cost(t, gasPriceOracle, int64(flzUpperBound), int64(len(txData))) + require.Equal(t, upperBoundCost.Uint64(), upperBound.Uint64()) +} + +// The new cost function: +// l1BaseFeeScaled = l1BaseFeeScalar * l1BaseFee * 16 +// l1BlobFeeScaled = l1BlobFeeScalar * l1BlobBaseFee +// l1FeeScaled = l1BaseFeeScaled + l1BlobFeeScaled +// ((intercept + fastlzCoef*fastlzLength + uncompressedTxCoef*uncompressedTxSize) * l1FeeScaled) / 1e12 +func fjordL1Cost( + t require.TestingT, + gasPriceOracle *bindings.GasPriceOracleCaller, + fastLzLength, + unsignedTxSize int64, +) *big.Int { + baseFeeScalar, err := gasPriceOracle.BaseFeeScalar(nil) + require.NoError(t, err) + l1BaseFee, err := gasPriceOracle.L1BaseFee(nil) + require.NoError(t, err) + blobBaseFeeScalar, err := gasPriceOracle.BlobBaseFeeScalar(nil) + require.NoError(t, err) + blobBaseFee, err := gasPriceOracle.BlobBaseFee(nil) + require.NoError(t, err) + + feeScaled := new(big.Int).Mul(new(big.Int).SetUint64(uint64(baseFeeScalar)), big.NewInt(16)) + feeScaled = new(big.Int).Mul(feeScaled, l1BaseFee) + feeScaled = new(big.Int).Add(feeScaled, new(big.Int).Mul(new(big.Int).SetUint64(uint64(blobBaseFeeScalar)), blobBaseFee)) + + cost := new(big.Int).Mul(new(big.Int).SetInt64(costFastlzCoef), new(big.Int).SetInt64(fastLzLength+68)) + cost = new(big.Int).Add(cost, new(big.Int).SetInt64(costIntercept)) + cost = new(big.Int).Add(cost, new(big.Int).Mul(new(big.Int).SetInt64(costTxSizeCoef), new(big.Int).SetInt64(unsignedTxSize+68))) + require.True(t, cost.Sign() >= 0) + + cost = new(big.Int).Mul(cost, feeScaled) + cost = new(big.Int).Div(cost, new(big.Int).SetInt64(int64(1e12))) + + return cost +} diff --git a/op-e2e/actions/l2_sequencer.go b/op-e2e/actions/l2_sequencer.go index c1c93cf74de..dfd4c80c406 100644 --- a/op-e2e/actions/l2_sequencer.go +++ b/op-e2e/actions/l2_sequencer.go @@ -175,3 +175,10 @@ func (s *L2Sequencer) ActBuildL2ToEcotone(t Testing) { s.ActL2EndBlock(t) } } +func (s *L2Sequencer) ActBuildL2ToFjord(t Testing) { + require.NotNil(t, s.rollupCfg.FjordTime, "cannot activate FjordTime when it is not scheduled") + for s.L2Unsafe().Time < *s.rollupCfg.FjordTime { + s.ActL2StartBlock(t) + s.ActL2EndBlock(t) + } +} diff --git a/op-e2e/gas_price_oracle_test.go b/op-e2e/gas_price_oracle_test.go new file mode 100644 index 00000000000..47c6a589af8 --- /dev/null +++ b/op-e2e/gas_price_oracle_test.go @@ -0,0 +1,135 @@ +package op_e2e + +import ( + "encoding/binary" + "encoding/hex" + "fmt" + "io/fs" + "math/big" + "os" + "path/filepath" + "testing" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + "github.com/stretchr/testify/assert" + + "github.com/ethereum-optimism/optimism/op-bindings/bindings" + "github.com/ethereum-optimism/optimism/op-bindings/predeploys" +) + +func inputsToHex(inputs []interface{}) ([]byte, error) { + resultBytes := []byte{} + for _, input := range inputs { + switch v := input.(type) { + case int32: + bytes := make([]byte, 4) + binary.BigEndian.PutUint32(bytes, uint32(v)) + resultBytes = append(resultBytes, bytes...) + case uint32: + bytes := make([]byte, 4) + binary.BigEndian.PutUint32(bytes, v) + resultBytes = append(resultBytes, bytes...) + case uint64: + bytes := make([]byte, 8) + binary.BigEndian.PutUint64(bytes, v) + resultBytes = append(resultBytes, bytes...) + default: + return nil, fmt.Errorf("unsupported type: %T", v) + } + } + // Print the hex-encoded string of 28 bytes + return resultBytes, nil +} + +func TestGasPriceOracle(t *testing.T) { + + var ( + sequenceNumber uint64 = 0 + blobFeeScalar uint32 = 1_250_000 + baseFeeScalar uint32 = 11_111 + costTxSizeCoef int32 = -88_664 + costFastlzCoef int32 = 1_031_462 + costIntercept int32 = -27_321_890 + ) + + inputs := []interface{}{baseFeeScalar, blobFeeScalar, sequenceNumber} + payload, err := inputsToHex(inputs) + assert.NoError(t, err) + + byteResult := append(make([]byte, 4), payload...) + + backend := backends.NewSimulatedBackend(map[common.Address]core.GenesisAccount{ + predeploys.GasPriceOracleAddr: { + Code: common.FromHex(bindings.GasPriceOracleDeployedBin), + Balance: big.NewInt(0), + Storage: map[common.Hash]common.Hash{ + common.HexToHash("0x0"): common.HexToHash("0x0101"), // isEcotone = true, isFjord = true + }, + }, + predeploys.L1BlockAddr: { + Code: common.FromHex(bindings.L1BlockDeployedBin), + Balance: big.NewInt(0), + Storage: map[common.Hash]common.Hash{ + common.HexToHash("0x1"): common.HexToHash("0x01"), // l1BaseFee 1 + common.HexToHash("0x3"): common.HexToHash(hex.EncodeToString(byteResult)), // all other constants + common.HexToHash("0x7"): common.HexToHash("0x01"), // l1BlobBaseFee 1 + }, + }, + }, math.MaxUint64) + + caller, err := bindings.NewGasPriceOracleCaller(predeploys.GasPriceOracleAddr, backend) + assert.NoError(t, err) + + atLeastOnce := false + err = filepath.WalkDir("../specs", func(path string, d fs.DirEntry, err error) error { + if d.IsDir() { + return nil + } + b, err := os.ReadFile(path) + if err != nil { + return err + } + + used, err := caller.GetL1Fee(&bind.CallOpts{}, b) + if err != nil { + return err + } + + l1BaseFee, err := caller.L1BaseFee(&bind.CallOpts{}) + + if err != nil { + return err + } + + l1BaseFeeScaled := uint64(baseFeeScalar) * l1BaseFee.Uint64() * 16 + l1BlobBaseFee, err := caller.BlobBaseFee(&bind.CallOpts{}) + if err != nil { + return err + } + + l1BlobFeeScaled := uint64(blobFeeScalar) * l1BlobBaseFee.Uint64() + l1FeeScaled := l1BaseFeeScaled + l1BlobFeeScaled + fastLzLength := types.FlzCompressLen(b) + txSize := len(b) + 68 + expected := ((int64(costIntercept) + int64(costFastlzCoef)*int64(fastLzLength+68) + int64(costTxSizeCoef)*int64(txSize)) * int64(l1FeeScaled)) / 1e12 + assert.Equal(t, uint64(expected), used.Uint64(), path) + + upperBound, err := caller.GetL1FeeUpperBound(&bind.CallOpts{}, big.NewInt(int64(len(b)))) + if err != nil { + return err + } + flzUpperBound := txSize + txSize/255 + 16 + expectedFeeUpperBound := ((int64(costIntercept) + int64(costFastlzCoef)*int64(flzUpperBound) + int64(costTxSizeCoef)*int64(txSize)) * int64(l1FeeScaled)) / 1e12 + assert.Equal(t, uint64(expectedFeeUpperBound), upperBound.Uint64(), path) + + atLeastOnce = true + return nil + }) + assert.NoError(t, err) + assert.True(t, atLeastOnce) +} diff --git a/op-node/chaincfg/chains_test.go b/op-node/chaincfg/chains_test.go index 6b1c1497552..2e90915e1b8 100644 --- a/op-node/chaincfg/chains_test.go +++ b/op-node/chaincfg/chains_test.go @@ -4,10 +4,11 @@ import ( "math/big" "testing" - "github.com/ethereum-optimism/optimism/op-node/rollup" - "github.com/ethereum-optimism/optimism/op-service/eth" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" + + "github.com/ethereum-optimism/optimism/op-node/rollup" + "github.com/ethereum-optimism/optimism/op-service/eth" ) // TestGetRollupConfig tests that the configs sourced from the superchain-registry match diff --git a/op-node/rollup/derive/attributes.go b/op-node/rollup/derive/attributes.go index 0be6198374b..c65198bcec7 100644 --- a/op-node/rollup/derive/attributes.go +++ b/op-node/rollup/derive/attributes.go @@ -108,6 +108,14 @@ func (ba *FetchingAttributesBuilder) PreparePayloadAttributes(ctx context.Contex } } + if ba.rollupCfg.IsFjordActivationBlock(nextL2Time) { + fjord, err := FjordNetworkUpgradeTransactions() + if err != nil { + return nil, NewCriticalError(fmt.Errorf("failed to build fjord network upgrade txs: %w", err)) + } + upgradeTxs = append(upgradeTxs, fjord...) + } + l1InfoTx, err := L1InfoDepositBytes(ba.rollupCfg, sysConfig, seqNumber, l1Info, nextL2Time) if err != nil { return nil, NewCriticalError(fmt.Errorf("failed to create l1InfoTx: %w", err)) diff --git a/op-node/rollup/derive/fjord_upgrade_transactions.go b/op-node/rollup/derive/fjord_upgrade_transactions.go new file mode 100644 index 00000000000..efbd92aecd1 --- /dev/null +++ b/op-node/rollup/derive/fjord_upgrade_transactions.go @@ -0,0 +1,88 @@ +package derive + +import ( + "math/big" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + + "github.com/ethereum-optimism/optimism/op-bindings/predeploys" +) + +var ( + // Gas Price Oracle Parameters + deployFjordGasPriceOracleSource = UpgradeDepositSource{Intent: "Fjord: Gas Price Oracle Deployment"} + GasPriceOracleFjordDeployerAddress = common.HexToAddress("0x4210000000000000000000000000000000000003") + gasPriceOracleFjordDeploymentBytecode = common.FromHex("0x608060405234801561001057600080fd5b50611928806100206000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80636ef25c3a116100b2578063de26c4a111610081578063f45e65d811610066578063f45e65d81461025b578063f820614014610263578063fe173b971461020d57600080fd5b8063de26c4a114610235578063f1c7a58b1461024857600080fd5b80636ef25c3a1461020d5780638e98b10614610213578063960e3a231461021b578063c59859181461022d57600080fd5b806349948e0e11610109578063519b4bd3116100ee578063519b4bd31461019f57806354fd4d50146101a757806368d5dca6146101f057600080fd5b806349948e0e1461016f5780634ef6e2241461018257600080fd5b80630c18c1621461013b57806322b90ab3146101565780632e0f262514610160578063313ce56714610168575b600080fd5b61014361026b565b6040519081526020015b60405180910390f35b61015e61038c565b005b610143600681565b6006610143565b61014361017d36600461132d565b6105af565b60005461018f9060ff1681565b604051901515815260200161014d565b6101436105ec565b6101e36040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b60405161014d91906113fc565b6101f861064d565b60405163ffffffff909116815260200161014d565b48610143565b61015e6106d2565b60005461018f90610100900460ff1681565b6101f86108d4565b61014361024336600461132d565b610935565b61014361025636600461146f565b6109e9565b610143610ad1565b610143610bc4565b6000805460ff1615610304576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f47617350726963654f7261636c653a206f76657268656164282920697320646560448201527f707265636174656400000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611488565b905090565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040f91906114a1565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e2073657420697345636f746f6e6520666c6160648201527f6700000000000000000000000000000000000000000000000000000000000000608482015260a4016102fb565b60005460ff1615610582576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a2045636f746f6e6520616c72656164792060448201527f616374697665000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60008054610100900460ff16156105cf576105c982610c25565b92915050565b60005460ff16156105e3576105c982610c4f565b6105c982610cf3565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106ae573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038791906114d7565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa158015610731573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075591906114a1565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461080f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e20736574206973466a6f726420666c61670060648201526084016102fb565b600054610100900460ff16156108a6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f47617350726963654f7261636c653a20466a6f726420616c726561647920616360448201527f746976650000000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106ae573d6000803e3d6000fd5b60008061094183610e47565b60005490915060ff16156109555792915050565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d89190611488565b6109e2908261152c565b9392505050565b60008054610100900460ff16610a81576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f47617350726963654f7261636c653a206765744c314665655570706572426f7560448201527f6e64206f6e6c7920737570706f72747320466a6f72640000000000000000000060648201526084016102fb565b6000610a8e60ff84611573565b610a9890846115db565b610aa39060106115db565b610aae9060446115db565b90506000610abd8460446115db565b9050610ac98282610ed7565b949350505050565b6000805460ff1615610b65576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a207363616c61722829206973206465707260448201527f656361746564000000000000000000000000000000000000000000000000000060648201526084016102fb565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600080610c3183610fe1565b51610c3d90604461152c565b9050600083516044610abd919061152c565b600080610c5b83610e47565b90506000610c676105ec565b610c6f6108d4565b610c7a90601061164f565b63ffffffff16610c8a919061167b565b90506000610c96610bc4565b610c9e61064d565b63ffffffff16610cae919061167b565b90506000610cbc828461152c565b610cc6908561167b565b9050610cd46006600a6117d8565b610cdf90601061167b565b610ce990826117e4565b9695505050505050565b600080610cff83610e47565b9050600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d869190611488565b610d8e6105ec565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ded573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e119190611488565b610e1b908561152c565b610e25919061167b565b610e2f919061167b565b9050610e3d6006600a6117d8565b610ac990826117e4565b80516000908190815b81811015610eca57848181518110610e6a57610e6a6117f8565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016600003610eaa57610ea360048461152c565b9250610eb8565b610eb560108461152c565b92505b80610ec281611827565b915050610e50565b50610ac98261044061152c565b600080610ee2610bc4565b610eea61064d565b63ffffffff16610efa919061167b565b610f026105ec565b610f0a6108d4565b610f1590601061164f565b63ffffffff16610f25919061167b565b610f2f919061152c565b90506000610f5d847ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffea5a861185f565b610f6a86620fbd2661185f565b610f94907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe5f19de6115db565b610f9e91906115db565b90506000811215610fad575060005b610fb96006600261167b565b610fc490600a6117d8565b610fce838361167b565b610fd891906117e4565b95945050505050565b6060611170565b818153600101919050565b600082840393505b838110156109e25782810151828201511860001a1590930292600101610ffb565b825b60208210611068578251611033601f83610fe8565b52602092909201917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09091019060210161101e565b81156109e257825161107d6001840383610fe8565b520160010192915050565b60006001830392505b61010782106110c9576110bb8360ff166110b660fd6110b68760081c60e00189610fe8565b610fe8565b935061010682039150611091565b600782106110f6576110ef8360ff166110b6600785036110b68760081c60e00189610fe8565b90506109e2565b610ac98360ff166110b68560081c8560051b0187610fe8565b61116882820361114c61113c84600081518060001a8160011a60081b178160021a60101b17915050919050565b639e3779b90260131c611fff1690565b8060021b6040510182815160e01c1860e01b8151188152505050565b600101919050565b6180003860405139618000604051016020830180600d8551820103826002015b818110156112a3576000805b50508051604051600082901a600183901a60081b1760029290921a60101b91909117639e3779b9810260111c617ffc16909101805160e081811c878603811890911b909118909152840190818303908484106111f85750611233565b600184019350611fff821161122d578251600081901a600182901a60081b1760029190911a60101b17810361122d5750611233565b5061119c565b8383106112415750506112a3565b6001830392508583111561125f5761125c878788860361101c565b96505b611273600985016003850160038501610ff3565b9150611280878284611088565b965050611298846112938684860161110f565b61110f565b915050809350611190565b50506112b5838384885185010361101c565b925050506040519150618000820180820391508183526020830160005b838110156112ea5782810151828201526020016112d2565b506000920191825250602001604052919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561133f57600080fd5b813567ffffffffffffffff8082111561135757600080fd5b818401915084601f83011261136b57600080fd5b81358181111561137d5761137d6112fe565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156113c3576113c36112fe565b816040528281528760208487010111156113dc57600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b818110156114295785810183015185820160400152820161140d565b8181111561143b576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60006020828403121561148157600080fd5b5035919050565b60006020828403121561149a57600080fd5b5051919050565b6000602082840312156114b357600080fd5b815173ffffffffffffffffffffffffffffffffffffffff811681146109e257600080fd5b6000602082840312156114e957600080fd5b815163ffffffff811681146109e257600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561153f5761153f6114fd565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261158257611582611544565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f8000000000000000000000000000000000000000000000000000000000000000831416156115d6576115d66114fd565b500590565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03841381151615611615576116156114fd565b827f8000000000000000000000000000000000000000000000000000000000000000038412811615611649576116496114fd565b50500190565b600063ffffffff80831681851681830481118215151615611672576116726114fd565b02949350505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156116b3576116b36114fd565b500290565b600181815b8085111561171157817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156116f7576116f76114fd565b8085161561170457918102915b93841c93908002906116bd565b509250929050565b600082611728575060016105c9565b81611735575060006105c9565b816001811461174b576002811461175557611771565b60019150506105c9565b60ff841115611766576117666114fd565b50506001821b6105c9565b5060208310610133831016604e8410600b8410161715611794575081810a6105c9565b61179e83836116b8565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156117d0576117d06114fd565b029392505050565b60006109e28383611719565b6000826117f3576117f3611544565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611858576118586114fd565b5060010190565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000841360008413858304851182821616156118a0576118a06114fd565b7f800000000000000000000000000000000000000000000000000000000000000060008712868205881281841616156118db576118db6114fd565b600087129250878205871284841616156118f7576118f76114fd565b8785058712818416161561190d5761190d6114fd565b50505092909302939250505056fea164736f6c634300080f000a") + + // Update L1Block Proxy Parameters + updateFjordL1BlockProxySource = UpgradeDepositSource{Intent: "Fjord: L1 Block Proxy Update"} + fjordL1BlockAddress = common.HexToAddress("0xa919894851548179A0750865e7974DA599C0Fac7") + + // Update GasPricePriceOracle Proxy Parameters + updateFjordGasPriceOracleSource = UpgradeDepositSource{Intent: "Fjord: Gas Price Oracle Proxy Update"} + fjordGasPriceOracleAddress = common.HexToAddress("0xFf256497D61dcd71a9e9Ff43967C13fdE1F72D12") + + // Enable Fjord Parameters + enableFjordSource = UpgradeDepositSource{Intent: "Fjord: Gas Price Oracle Set Fjord"} + enableFjordInput = crypto.Keccak256([]byte("setFjord()"))[:4] +) + +// FjordNetworkUpgradeTransactions returns the transactions required to upgrade the Fjord network. +func FjordNetworkUpgradeTransactions() ([]hexutil.Bytes, error) { + upgradeTxns := make([]hexutil.Bytes, 0, 3) + + // Deploy Gas Price Oracle transaction + deployGasPriceOracle, err := types.NewTx(&types.DepositTx{ + SourceHash: deployFjordGasPriceOracleSource.SourceHash(), + From: GasPriceOracleFjordDeployerAddress, + To: nil, + Mint: big.NewInt(0), + Value: big.NewInt(0), + Gas: 1_450_000, + IsSystemTransaction: false, + Data: gasPriceOracleFjordDeploymentBytecode, + }).MarshalBinary() + + if err != nil { + return nil, err + } + + upgradeTxns = append(upgradeTxns, deployGasPriceOracle) + + updateGasPriceOracleProxy, err := types.NewTx(&types.DepositTx{ + SourceHash: updateFjordGasPriceOracleSource.SourceHash(), + From: common.Address{}, + To: &predeploys.GasPriceOracleAddr, + Mint: big.NewInt(0), + Value: big.NewInt(0), + Gas: 50_000, + IsSystemTransaction: false, + Data: upgradeToCalldata(fjordGasPriceOracleAddress), + }).MarshalBinary() + + if err != nil { + return nil, err + } + + upgradeTxns = append(upgradeTxns, updateGasPriceOracleProxy) + + enableFjord, err := types.NewTx(&types.DepositTx{ + SourceHash: enableFjordSource.SourceHash(), + From: L1InfoDepositerAddress, + To: &predeploys.GasPriceOracleAddr, + Mint: big.NewInt(0), + Value: big.NewInt(0), + Gas: 80_000, + IsSystemTransaction: false, + Data: enableFjordInput, + }).MarshalBinary() + if err != nil { + return nil, err + } + upgradeTxns = append(upgradeTxns, enableFjord) + + return upgradeTxns, nil +} diff --git a/op-node/rollup/derive/fjord_upgrade_transactions_test.go b/op-node/rollup/derive/fjord_upgrade_transactions_test.go new file mode 100644 index 00000000000..e91306a2607 --- /dev/null +++ b/op-node/rollup/derive/fjord_upgrade_transactions_test.go @@ -0,0 +1,62 @@ +package derive + +import ( + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/stretchr/testify/require" + + "github.com/ethereum-optimism/optimism/op-bindings/bindings" +) + +func TestFjordSourcesMatchSpec(t *testing.T) { + for _, test := range []struct { + source UpgradeDepositSource + expectedHash string + }{ + { + source: deployFjordGasPriceOracleSource, + expectedHash: "0x86122c533fdcb89b16d8713174625e44578a89751d96c098ec19ab40a51a8ea3", + }, + { + source: updateFjordGasPriceOracleSource, + expectedHash: "0x1e6bb0c28bfab3dc9b36ffb0f721f00d6937f33577606325692db0965a7d58c6", + }, + { + source: enableFjordSource, + expectedHash: "0xbac7bb0d5961cad209a345408b0280a0d4686b1b20665e1b0f9cdafd73b19b6b", + }, + } { + require.Equal(t, common.HexToHash(test.expectedHash), test.source.SourceHash()) + } +} + +func TestFjordNetworkTransactions(t *testing.T) { + upgradeTxns, err := FjordNetworkUpgradeTransactions() + require.NoError(t, err) + require.Len(t, upgradeTxns, 3) + + deployGasPriceOracleSender, deployGasPriceOracle := toDepositTxn(t, upgradeTxns[0]) + require.Equal(t, deployGasPriceOracleSender, common.HexToAddress("0x4210000000000000000000000000000000000003")) + require.Equal(t, deployFjordGasPriceOracleSource.SourceHash(), deployGasPriceOracle.SourceHash()) + require.Nil(t, deployGasPriceOracle.To()) + require.Equal(t, uint64(1_450_000), deployGasPriceOracle.Gas()) + require.Equal(t, bindings.GasPriceOracleMetaData.Bin, hexutil.Bytes(deployGasPriceOracle.Data()).String()) + + updateGasPriceOracleSender, updateGasPriceOracle := toDepositTxn(t, upgradeTxns[1]) + require.Equal(t, updateGasPriceOracleSender, common.Address{}) + require.Equal(t, updateFjordGasPriceOracleSource.SourceHash(), updateGasPriceOracle.SourceHash()) + require.NotNil(t, updateGasPriceOracle.To()) + require.Equal(t, *updateGasPriceOracle.To(), common.HexToAddress("0x420000000000000000000000000000000000000F")) + require.Equal(t, uint64(50_000), updateGasPriceOracle.Gas()) + require.Equal(t, common.FromHex("0x3659cfe6000000000000000000000000ff256497d61dcd71a9e9ff43967c13fde1f72d12"), updateGasPriceOracle.Data()) + + gpoSetFjordSender, gpoSetFjord := toDepositTxn(t, upgradeTxns[2]) + require.Equal(t, gpoSetFjordSender, common.HexToAddress("0xDeaDDEaDDeAdDeAdDEAdDEaddeAddEAdDEAd0001")) + require.Equal(t, enableFjordSource.SourceHash(), gpoSetFjord.SourceHash()) + require.NotNil(t, gpoSetFjord.To()) + require.Equal(t, *gpoSetFjord.To(), common.HexToAddress("0x420000000000000000000000000000000000000F")) + require.Equal(t, uint64(80_000), gpoSetFjord.Gas()) + require.Equal(t, common.FromHex("0x8e98b106"), gpoSetFjord.Data()) +} diff --git a/op-node/rollup/derive/l1_block_info.go b/op-node/rollup/derive/l1_block_info.go index 93c529750ef..bd44e058e47 100644 --- a/op-node/rollup/derive/l1_block_info.go +++ b/op-node/rollup/derive/l1_block_info.go @@ -270,6 +270,7 @@ func L1InfoDeposit(rollupCfg *rollup.Config, sysCfg eth.SystemConfig, seqNumber BatcherAddr: sysCfg.BatcherAddr, } var data []byte + if isEcotoneButNotFirstBlock(rollupCfg, l2BlockTime) { l1BlockInfo.BlobBaseFee = block.BlobBaseFee() if l1BlockInfo.BlobBaseFee == nil { diff --git a/op-node/rollup/derive/system_config.go b/op-node/rollup/derive/system_config.go index 6b0dbe50411..597fc6bbb1e 100644 --- a/op-node/rollup/derive/system_config.go +++ b/op-node/rollup/derive/system_config.go @@ -111,7 +111,15 @@ func ProcessSystemConfigUpdateLogEvent(destSysCfg *eth.SystemConfig, ev *types.L if !solabi.EmptyReader(reader) { return NewCriticalError(errors.New("too many bytes")) } - if rollupCfg.IsEcotone(l1Time) { + if rollupCfg.IsFjord(l1Time) { + if err := eth.CheckFjordL1SystemConfigScalar(scalar); err != nil { + return nil // ignore invalid scalars, retain the old system-config scalar + } + // retain the scalar data in encoded form + destSysCfg.Scalar = scalar + // zero out the overhead, it will not affect the state-transition after Ecotone + destSysCfg.Overhead = eth.Bytes32{} + } else if rollupCfg.IsEcotone(l1Time) { if err := eth.CheckEcotoneL1SystemConfigScalar(scalar); err != nil { return nil // ignore invalid scalars, retain the old system-config scalar } diff --git a/op-node/rollup/driver/sequencer.go b/op-node/rollup/driver/sequencer.go index 1ee5038d2b4..b46db64b1a0 100644 --- a/op-node/rollup/driver/sequencer.go +++ b/op-node/rollup/driver/sequencer.go @@ -101,6 +101,12 @@ func (d *Sequencer) StartBuildingBlock(ctx context.Context) error { d.log.Info("Sequencing Ecotone upgrade block") } + // For the Fjord activation block we shouldn't include any sequencer transactions. + if d.rollupCfg.IsFjordActivationBlock(uint64(attrs.Timestamp)) { + attrs.NoTxPool = true + d.log.Info("Sequencing Fjord upgrade block") + } + d.log.Debug("prepared attributes for new block", "num", l2Head.Number+1, "time", uint64(attrs.Timestamp), "origin", l1Origin, "origin_time", l1Origin.Time, "noTxPool", attrs.NoTxPool) diff --git a/op-node/rollup/types.go b/op-node/rollup/types.go index 22b3faf999d..ef675bd9158 100644 --- a/op-node/rollup/types.go +++ b/op-node/rollup/types.go @@ -407,6 +407,14 @@ func (c *Config) IsFjord(timestamp uint64) bool { return c.FjordTime != nil && timestamp >= *c.FjordTime } +// IsFjordActivationBlock returns whether the specified block is the first block subject to the +// Fjord upgrade. +func (c *Config) IsFjordActivationBlock(l2BlockTime uint64) bool { + return c.IsFjord(l2BlockTime) && + l2BlockTime >= c.BlockTime && + !c.IsFjord(l2BlockTime-c.BlockTime) +} + // IsInterop returns true if the Interop hardfork is active at or past the given timestamp. func (c *Config) IsInterop(timestamp uint64) bool { return c.InteropTime != nil && timestamp >= *c.InteropTime diff --git a/op-service/eth/types.go b/op-service/eth/types.go index 9f153684e94..d7d372ad416 100644 --- a/op-service/eth/types.go +++ b/op-service/eth/types.go @@ -28,7 +28,7 @@ const ( var ErrBedrockScalarPaddingNotEmpty = errors.New("version 0 scalar value has non-empty padding") -// InputError distinguishes an user-input error from regular rpc errors, +// InputError distinguishes a user-input error from regular rpc errors, // to help the (Engine) API user divert from accidental input mistakes. type InputError struct { Inner error @@ -391,47 +391,96 @@ const ( L1ScalarBedrock = byte(0) // L1ScalarEcotone is new in Ecotone, allowing configuration of both a regular and a blobs scalar. L1ScalarEcotone = byte(1) + // L1ScalarFjord is new in Fjord, allowing the configuration of the linear regression formula. + L1ScalarFjord = byte(2) ) -type EcostoneScalars struct { +type EcotoneScalars struct { BlobBaseFeeScalar uint32 BaseFeeScalar uint32 } -func (sysCfg *SystemConfig) EcotoneScalars() (EcostoneScalars, error) { +type FjordScalars struct { + BlobBaseFeeScalar uint32 + BaseFeeScalar uint32 + CostIntercept int32 + CostFastLzCoef int32 + CostTxSizeCoef int32 +} + +func (sysCfg *SystemConfig) FjordScalars() (FjordScalars, error) { + if err := CheckFjordL1SystemConfigScalar(sysCfg.Scalar); err != nil { + if errors.Is(err, ErrBedrockScalarPaddingNotEmpty) { + // L2 spec mandates we set baseFeeScalar to MaxUint32 if there are non-zero bytes in + // the padding area. + return FjordScalars{ + BlobBaseFeeScalar: 0, + BaseFeeScalar: math.MaxUint32, + CostIntercept: 0, + CostFastLzCoef: 0, + CostTxSizeCoef: 0, + }, nil + } + return FjordScalars{}, err + } + if sysCfg.Scalar[0] == L1ScalarFjord { + return FjordScalars{ + CostTxSizeCoef: int32(binary.BigEndian.Uint32(sysCfg.Scalar[12:16])), + CostFastLzCoef: int32(binary.BigEndian.Uint32(sysCfg.Scalar[16:20])), + CostIntercept: int32(binary.BigEndian.Uint32(sysCfg.Scalar[20:24])), + BlobBaseFeeScalar: binary.BigEndian.Uint32(sysCfg.Scalar[24:28]), + BaseFeeScalar: binary.BigEndian.Uint32(sysCfg.Scalar[28:32]), + }, nil + } else { + ecotoneScalars, err := sysCfg.EcotoneScalars() + if err != nil { + return FjordScalars{}, err + } + + return FjordScalars{ + BlobBaseFeeScalar: ecotoneScalars.BlobBaseFeeScalar, + BaseFeeScalar: ecotoneScalars.BaseFeeScalar, + CostIntercept: 0, + CostFastLzCoef: 0, + CostTxSizeCoef: 1_000_000, + }, nil + } +} + +func (sysCfg *SystemConfig) EcotoneScalars() (EcotoneScalars, error) { if err := CheckEcotoneL1SystemConfigScalar(sysCfg.Scalar); err != nil { if errors.Is(err, ErrBedrockScalarPaddingNotEmpty) { // L2 spec mandates we set baseFeeScalar to MaxUint32 if there are non-zero bytes in // the padding area. - return EcostoneScalars{BlobBaseFeeScalar: 0, BaseFeeScalar: math.MaxUint32}, nil + return EcotoneScalars{BlobBaseFeeScalar: 0, BaseFeeScalar: math.MaxUint32}, nil } - return EcostoneScalars{}, err + return EcotoneScalars{}, err } return DecodeScalar(sysCfg.Scalar) } // DecodeScalar decodes the blobBaseFeeScalar and baseFeeScalar from a 32-byte scalar value. // It uses the first byte to determine the scalar format. -func DecodeScalar(scalar [32]byte) (EcostoneScalars, error) { +func DecodeScalar(scalar [32]byte) (EcotoneScalars, error) { switch scalar[0] { case L1ScalarBedrock: - return EcostoneScalars{ + return EcotoneScalars{ BlobBaseFeeScalar: 0, BaseFeeScalar: binary.BigEndian.Uint32(scalar[28:32]), }, nil case L1ScalarEcotone: - return EcostoneScalars{ + return EcotoneScalars{ BlobBaseFeeScalar: binary.BigEndian.Uint32(scalar[24:28]), BaseFeeScalar: binary.BigEndian.Uint32(scalar[28:32]), }, nil default: - return EcostoneScalars{}, fmt.Errorf("unexpected system config scalar: %x", scalar) + return EcotoneScalars{}, fmt.Errorf("unexpected system config scalar: %x", scalar) } } -// EncodeScalar encodes the EcostoneScalars into a 32-byte scalar value +// EncodeScalar encodes the EcotoneScalars into a 32-byte scalar value // for the Ecotone serialization format. -func EncodeScalar(scalars EcostoneScalars) (scalar [32]byte) { +func EncodeScalar(scalars EcotoneScalars) (scalar [32]byte) { scalar[0] = L1ScalarEcotone binary.BigEndian.PutUint32(scalar[24:28], scalars.BlobBaseFeeScalar) binary.BigEndian.PutUint32(scalar[28:32], scalars.BaseFeeScalar) @@ -457,6 +506,17 @@ func CheckEcotoneL1SystemConfigScalar(scalar [32]byte) error { } } +func CheckFjordL1SystemConfigScalar(scalar [32]byte) error { + versionByte := scalar[0] + if versionByte == L1ScalarFjord { + if ([11]byte)(scalar[1:12]) != ([11]byte{}) { // check padding + return fmt.Errorf("invalid version 2 scalar padding: %x", scalar[1:12]) + } + return nil + } + return CheckEcotoneL1SystemConfigScalar(scalar) +} + type Bytes48 [48]byte func (b *Bytes48) UnmarshalJSON(text []byte) error { diff --git a/op-service/eth/types_test.go b/op-service/eth/types_test.go index 53a21332701..f62c14691a1 100644 --- a/op-service/eth/types_test.go +++ b/op-service/eth/types_test.go @@ -59,7 +59,7 @@ func TestEcotoneScalars(t *testing.T) { func FuzzEncodeScalar(f *testing.F) { f.Fuzz(func(t *testing.T, blobBaseFeeScalar uint32, baseFeeScalar uint32) { - encoded := EncodeScalar(EcostoneScalars{BlobBaseFeeScalar: blobBaseFeeScalar, BaseFeeScalar: baseFeeScalar}) + encoded := EncodeScalar(EcotoneScalars{BlobBaseFeeScalar: blobBaseFeeScalar, BaseFeeScalar: baseFeeScalar}) scalars, err := DecodeScalar(encoded) require.NoError(t, err) require.Equal(t, blobBaseFeeScalar, scalars.BlobBaseFeeScalar) From 1fc83a53d32973b7aad56c3cbf4fc77fc0ea1a64 Mon Sep 17 00:00:00 2001 From: Danyal Prout Date: Wed, 17 Apr 2024 10:33:25 -0500 Subject: [PATCH 02/14] fix all the tests --- op-e2e/actions/fjord_fork_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/op-e2e/actions/fjord_fork_test.go b/op-e2e/actions/fjord_fork_test.go index 2cb104754cb..d47d9dc3a5d 100644 --- a/op-e2e/actions/fjord_fork_test.go +++ b/op-e2e/actions/fjord_fork_test.go @@ -23,7 +23,7 @@ import ( ) var ( - fjordGasPriceOracleCodeHash = common.HexToHash("0x56d6f6aae2e5b1ed447f2094f5ba59b79404a8ccefcac4778dc4bba085bd7733") + fjordGasPriceOracleCodeHash = common.HexToHash("0x9ceff82dc9f9bf592dc3954dde0ce8466864229caa8916fffc4005e2fde3d589") // https://basescan.org/tx/0x8debb2fe54200183fb8baa3c6dbd8e6ec2e4f7a4add87416cd60336b8326d16a txHex = "02f875822105819b8405709fb884057d460082e97f94273ca93a52b817294830ed7572aa591ccfa647fd80881249c58b0021fb3fc080a05bb08ccfd68f83392e446dac64d88a2d28e7072c06502dfabc4a77e77b5c7913a05878d53dd4ebba4f6367e572d524dffcabeec3abb1d8725ee3ac5dc32e1852e3" @@ -62,6 +62,10 @@ func TestFjordNetworkUpgradeTransactions(gt *testing.T) { initialGasPriceOracleAddress, err := ethCl.StorageAt(context.Background(), predeploys.GasPriceOracleAddr, genesis.ImplementationSlot, nil) require.NoError(t, err) + // Get gas price from oracle + gasPriceOracle, err := bindings.NewGasPriceOracleCaller(predeploys.GasPriceOracleAddr, ethCl) + require.NoError(t, err) + // Build to the Fjord block sequencer.ActBuildL2ToFjord(t) @@ -93,10 +97,6 @@ func TestFjordNetworkUpgradeTransactions(gt *testing.T) { require.NotEqualf(t, initialGasPriceOracleAddress, updatedGasPriceOracleAddress, "Gas Price Oracle Proxy address should have changed") verifyCodeHashMatches(t, ethCl, expectedGasPriceOracleAddress, fjordGasPriceOracleCodeHash) - // Get gas price from oracle - gasPriceOracle, err := bindings.NewGasPriceOracleCaller(predeploys.GasPriceOracleAddr, ethCl) - require.NoError(t, err) - // Check that Fjord was activated isFjord, err := gasPriceOracle.IsFjord(nil) require.NoError(t, err) From 3a3a09dbd0d24823b354d78e008d30e3454bb51d Mon Sep 17 00:00:00 2001 From: Danyal Prout Date: Wed, 17 Apr 2024 10:40:12 -0500 Subject: [PATCH 03/14] fix: upate GPO network transactions to match spec --- op-node/rollup/derive/fjord_upgrade_transactions.go | 8 ++------ op-node/rollup/derive/fjord_upgrade_transactions_test.go | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/op-node/rollup/derive/fjord_upgrade_transactions.go b/op-node/rollup/derive/fjord_upgrade_transactions.go index efbd92aecd1..530fed257bb 100644 --- a/op-node/rollup/derive/fjord_upgrade_transactions.go +++ b/op-node/rollup/derive/fjord_upgrade_transactions.go @@ -14,16 +14,12 @@ import ( var ( // Gas Price Oracle Parameters deployFjordGasPriceOracleSource = UpgradeDepositSource{Intent: "Fjord: Gas Price Oracle Deployment"} - GasPriceOracleFjordDeployerAddress = common.HexToAddress("0x4210000000000000000000000000000000000003") + GasPriceOracleFjordDeployerAddress = common.HexToAddress("0x4210000000000000000000000000000000000002") gasPriceOracleFjordDeploymentBytecode = common.FromHex("0x608060405234801561001057600080fd5b50611928806100206000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80636ef25c3a116100b2578063de26c4a111610081578063f45e65d811610066578063f45e65d81461025b578063f820614014610263578063fe173b971461020d57600080fd5b8063de26c4a114610235578063f1c7a58b1461024857600080fd5b80636ef25c3a1461020d5780638e98b10614610213578063960e3a231461021b578063c59859181461022d57600080fd5b806349948e0e11610109578063519b4bd3116100ee578063519b4bd31461019f57806354fd4d50146101a757806368d5dca6146101f057600080fd5b806349948e0e1461016f5780634ef6e2241461018257600080fd5b80630c18c1621461013b57806322b90ab3146101565780632e0f262514610160578063313ce56714610168575b600080fd5b61014361026b565b6040519081526020015b60405180910390f35b61015e61038c565b005b610143600681565b6006610143565b61014361017d36600461132d565b6105af565b60005461018f9060ff1681565b604051901515815260200161014d565b6101436105ec565b6101e36040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b60405161014d91906113fc565b6101f861064d565b60405163ffffffff909116815260200161014d565b48610143565b61015e6106d2565b60005461018f90610100900460ff1681565b6101f86108d4565b61014361024336600461132d565b610935565b61014361025636600461146f565b6109e9565b610143610ad1565b610143610bc4565b6000805460ff1615610304576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f47617350726963654f7261636c653a206f76657268656164282920697320646560448201527f707265636174656400000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611488565b905090565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040f91906114a1565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e2073657420697345636f746f6e6520666c6160648201527f6700000000000000000000000000000000000000000000000000000000000000608482015260a4016102fb565b60005460ff1615610582576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a2045636f746f6e6520616c72656164792060448201527f616374697665000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60008054610100900460ff16156105cf576105c982610c25565b92915050565b60005460ff16156105e3576105c982610c4f565b6105c982610cf3565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106ae573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038791906114d7565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa158015610731573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075591906114a1565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461080f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e20736574206973466a6f726420666c61670060648201526084016102fb565b600054610100900460ff16156108a6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f47617350726963654f7261636c653a20466a6f726420616c726561647920616360448201527f746976650000000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106ae573d6000803e3d6000fd5b60008061094183610e47565b60005490915060ff16156109555792915050565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d89190611488565b6109e2908261152c565b9392505050565b60008054610100900460ff16610a81576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f47617350726963654f7261636c653a206765744c314665655570706572426f7560448201527f6e64206f6e6c7920737570706f72747320466a6f72640000000000000000000060648201526084016102fb565b6000610a8e60ff84611573565b610a9890846115db565b610aa39060106115db565b610aae9060446115db565b90506000610abd8460446115db565b9050610ac98282610ed7565b949350505050565b6000805460ff1615610b65576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a207363616c61722829206973206465707260448201527f656361746564000000000000000000000000000000000000000000000000000060648201526084016102fb565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600080610c3183610fe1565b51610c3d90604461152c565b9050600083516044610abd919061152c565b600080610c5b83610e47565b90506000610c676105ec565b610c6f6108d4565b610c7a90601061164f565b63ffffffff16610c8a919061167b565b90506000610c96610bc4565b610c9e61064d565b63ffffffff16610cae919061167b565b90506000610cbc828461152c565b610cc6908561167b565b9050610cd46006600a6117d8565b610cdf90601061167b565b610ce990826117e4565b9695505050505050565b600080610cff83610e47565b9050600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d869190611488565b610d8e6105ec565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ded573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e119190611488565b610e1b908561152c565b610e25919061167b565b610e2f919061167b565b9050610e3d6006600a6117d8565b610ac990826117e4565b80516000908190815b81811015610eca57848181518110610e6a57610e6a6117f8565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016600003610eaa57610ea360048461152c565b9250610eb8565b610eb560108461152c565b92505b80610ec281611827565b915050610e50565b50610ac98261044061152c565b600080610ee2610bc4565b610eea61064d565b63ffffffff16610efa919061167b565b610f026105ec565b610f0a6108d4565b610f1590601061164f565b63ffffffff16610f25919061167b565b610f2f919061152c565b90506000610f5d847ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffea5a861185f565b610f6a86620fbd2661185f565b610f94907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe5f19de6115db565b610f9e91906115db565b90506000811215610fad575060005b610fb96006600261167b565b610fc490600a6117d8565b610fce838361167b565b610fd891906117e4565b95945050505050565b6060611170565b818153600101919050565b600082840393505b838110156109e25782810151828201511860001a1590930292600101610ffb565b825b60208210611068578251611033601f83610fe8565b52602092909201917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09091019060210161101e565b81156109e257825161107d6001840383610fe8565b520160010192915050565b60006001830392505b61010782106110c9576110bb8360ff166110b660fd6110b68760081c60e00189610fe8565b610fe8565b935061010682039150611091565b600782106110f6576110ef8360ff166110b6600785036110b68760081c60e00189610fe8565b90506109e2565b610ac98360ff166110b68560081c8560051b0187610fe8565b61116882820361114c61113c84600081518060001a8160011a60081b178160021a60101b17915050919050565b639e3779b90260131c611fff1690565b8060021b6040510182815160e01c1860e01b8151188152505050565b600101919050565b6180003860405139618000604051016020830180600d8551820103826002015b818110156112a3576000805b50508051604051600082901a600183901a60081b1760029290921a60101b91909117639e3779b9810260111c617ffc16909101805160e081811c878603811890911b909118909152840190818303908484106111f85750611233565b600184019350611fff821161122d578251600081901a600182901a60081b1760029190911a60101b17810361122d5750611233565b5061119c565b8383106112415750506112a3565b6001830392508583111561125f5761125c878788860361101c565b96505b611273600985016003850160038501610ff3565b9150611280878284611088565b965050611298846112938684860161110f565b61110f565b915050809350611190565b50506112b5838384885185010361101c565b925050506040519150618000820180820391508183526020830160005b838110156112ea5782810151828201526020016112d2565b506000920191825250602001604052919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561133f57600080fd5b813567ffffffffffffffff8082111561135757600080fd5b818401915084601f83011261136b57600080fd5b81358181111561137d5761137d6112fe565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156113c3576113c36112fe565b816040528281528760208487010111156113dc57600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b818110156114295785810183015185820160400152820161140d565b8181111561143b576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60006020828403121561148157600080fd5b5035919050565b60006020828403121561149a57600080fd5b5051919050565b6000602082840312156114b357600080fd5b815173ffffffffffffffffffffffffffffffffffffffff811681146109e257600080fd5b6000602082840312156114e957600080fd5b815163ffffffff811681146109e257600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561153f5761153f6114fd565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261158257611582611544565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f8000000000000000000000000000000000000000000000000000000000000000831416156115d6576115d66114fd565b500590565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03841381151615611615576116156114fd565b827f8000000000000000000000000000000000000000000000000000000000000000038412811615611649576116496114fd565b50500190565b600063ffffffff80831681851681830481118215151615611672576116726114fd565b02949350505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156116b3576116b36114fd565b500290565b600181815b8085111561171157817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156116f7576116f76114fd565b8085161561170457918102915b93841c93908002906116bd565b509250929050565b600082611728575060016105c9565b81611735575060006105c9565b816001811461174b576002811461175557611771565b60019150506105c9565b60ff841115611766576117666114fd565b50506001821b6105c9565b5060208310610133831016604e8410600b8410161715611794575081810a6105c9565b61179e83836116b8565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156117d0576117d06114fd565b029392505050565b60006109e28383611719565b6000826117f3576117f3611544565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611858576118586114fd565b5060010190565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000841360008413858304851182821616156118a0576118a06114fd565b7f800000000000000000000000000000000000000000000000000000000000000060008712868205881281841616156118db576118db6114fd565b600087129250878205871284841616156118f7576118f76114fd565b8785058712818416161561190d5761190d6114fd565b50505092909302939250505056fea164736f6c634300080f000a") - // Update L1Block Proxy Parameters - updateFjordL1BlockProxySource = UpgradeDepositSource{Intent: "Fjord: L1 Block Proxy Update"} - fjordL1BlockAddress = common.HexToAddress("0xa919894851548179A0750865e7974DA599C0Fac7") - // Update GasPricePriceOracle Proxy Parameters updateFjordGasPriceOracleSource = UpgradeDepositSource{Intent: "Fjord: Gas Price Oracle Proxy Update"} - fjordGasPriceOracleAddress = common.HexToAddress("0xFf256497D61dcd71a9e9Ff43967C13fdE1F72D12") + fjordGasPriceOracleAddress = common.HexToAddress("0xa919894851548179A0750865e7974DA599C0Fac7") // Enable Fjord Parameters enableFjordSource = UpgradeDepositSource{Intent: "Fjord: Gas Price Oracle Set Fjord"} diff --git a/op-node/rollup/derive/fjord_upgrade_transactions_test.go b/op-node/rollup/derive/fjord_upgrade_transactions_test.go index e91306a2607..715b4f0844c 100644 --- a/op-node/rollup/derive/fjord_upgrade_transactions_test.go +++ b/op-node/rollup/derive/fjord_upgrade_transactions_test.go @@ -38,7 +38,7 @@ func TestFjordNetworkTransactions(t *testing.T) { require.Len(t, upgradeTxns, 3) deployGasPriceOracleSender, deployGasPriceOracle := toDepositTxn(t, upgradeTxns[0]) - require.Equal(t, deployGasPriceOracleSender, common.HexToAddress("0x4210000000000000000000000000000000000003")) + require.Equal(t, deployGasPriceOracleSender, common.HexToAddress("0x4210000000000000000000000000000000000002")) require.Equal(t, deployFjordGasPriceOracleSource.SourceHash(), deployGasPriceOracle.SourceHash()) require.Nil(t, deployGasPriceOracle.To()) require.Equal(t, uint64(1_450_000), deployGasPriceOracle.Gas()) @@ -50,7 +50,7 @@ func TestFjordNetworkTransactions(t *testing.T) { require.NotNil(t, updateGasPriceOracle.To()) require.Equal(t, *updateGasPriceOracle.To(), common.HexToAddress("0x420000000000000000000000000000000000000F")) require.Equal(t, uint64(50_000), updateGasPriceOracle.Gas()) - require.Equal(t, common.FromHex("0x3659cfe6000000000000000000000000ff256497d61dcd71a9e9ff43967c13fde1f72d12"), updateGasPriceOracle.Data()) + require.Equal(t, common.FromHex("0x3659cfe6000000000000000000000000a919894851548179A0750865e7974DA599C0Fac7"), updateGasPriceOracle.Data()) gpoSetFjordSender, gpoSetFjord := toDepositTxn(t, upgradeTxns[2]) require.Equal(t, gpoSetFjordSender, common.HexToAddress("0xDeaDDEaDDeAdDeAdDEAdDEaddeAddEAdDEAd0001")) From e899ea640a34084f26a8d11e9f1f298bfc8e8a39 Mon Sep 17 00:00:00 2001 From: Danyal Prout Date: Mon, 22 Apr 2024 18:58:39 -0500 Subject: [PATCH 04/14] Update GPO contracts --- .circleci/config.yml | 5 +++ CONTRIBUTING.md | 2 +- op-bindings/bindings/gaspriceoracle.go | 2 +- op-e2e/Makefile | 4 +++ op-e2e/actions/fjord_fork_test.go | 47 ++++++++++++++++++++++++++ op-service/sources/l1_beacon_client.go | 1 + 6 files changed, 59 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a98a8a8672e..fbcc1a3186e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1758,6 +1758,11 @@ workflows: on_changes: cannon,packages/contracts-bedrock/src/cannon uses_artifacts: true requires: ["go-mod-download", "pnpm-monorepo"] + - fuzz-golang: + name: op-e2e-fuzz + package_name: op-e2e + on_changes: op-e2e,packages/contracts-bedrock/src/ + requires: [ "go-mod-download" ] - go-test: name: op-heartbeat-tests module: op-heartbeat diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c854c6eb91e..09dba3ad11f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -68,7 +68,7 @@ You'll need the following: * [pnpm](https://pnpm.io/installation) * [Docker](https://docs.docker.com/get-docker/) * [Docker Compose](https://docs.docker.com/compose/install/) -* [Go](https://go.dev/dl/) +* [Go](h0ttps://go.dev/dl/) * [Foundry](https://getfoundry.sh) * [jq](https://jqlang.github.io/jq/) * [go-ethereum](https://github.com/ethereum/go-ethereum) diff --git a/op-bindings/bindings/gaspriceoracle.go b/op-bindings/bindings/gaspriceoracle.go index 52dbc2e810c..9072a349625 100644 --- a/op-bindings/bindings/gaspriceoracle.go +++ b/op-bindings/bindings/gaspriceoracle.go @@ -31,7 +31,7 @@ var ( // GasPriceOracleMetaData contains all meta data concerning the GasPriceOracle contract. var GasPriceOracleMetaData = &bind.MetaData{ ABI: "[{\"type\":\"function\",\"name\":\"DECIMALS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"baseFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"baseFeeScalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blobBaseFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blobBaseFeeScalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decimals\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"gasPrice\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getL1Fee\",\"inputs\":[{\"name\":\"_data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getL1FeeUpperBound\",\"inputs\":[{\"name\":\"_unsignedTxSize\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getL1GasUsed\",\"inputs\":[{\"name\":\"_data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isEcotone\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isFjord\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"l1BaseFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"overhead\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"scalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setEcotone\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setFjord\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"}]", - Bin: "0x608060405234801561001057600080fd5b50611928806100206000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80636ef25c3a116100b2578063de26c4a111610081578063f45e65d811610066578063f45e65d81461025b578063f820614014610263578063fe173b971461020d57600080fd5b8063de26c4a114610235578063f1c7a58b1461024857600080fd5b80636ef25c3a1461020d5780638e98b10614610213578063960e3a231461021b578063c59859181461022d57600080fd5b806349948e0e11610109578063519b4bd3116100ee578063519b4bd31461019f57806354fd4d50146101a757806368d5dca6146101f057600080fd5b806349948e0e1461016f5780634ef6e2241461018257600080fd5b80630c18c1621461013b57806322b90ab3146101565780632e0f262514610160578063313ce56714610168575b600080fd5b61014361026b565b6040519081526020015b60405180910390f35b61015e61038c565b005b610143600681565b6006610143565b61014361017d36600461132d565b6105af565b60005461018f9060ff1681565b604051901515815260200161014d565b6101436105ec565b6101e36040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b60405161014d91906113fc565b6101f861064d565b60405163ffffffff909116815260200161014d565b48610143565b61015e6106d2565b60005461018f90610100900460ff1681565b6101f86108d4565b61014361024336600461132d565b610935565b61014361025636600461146f565b6109e9565b610143610ad1565b610143610bc4565b6000805460ff1615610304576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f47617350726963654f7261636c653a206f76657268656164282920697320646560448201527f707265636174656400000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611488565b905090565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040f91906114a1565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e2073657420697345636f746f6e6520666c6160648201527f6700000000000000000000000000000000000000000000000000000000000000608482015260a4016102fb565b60005460ff1615610582576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a2045636f746f6e6520616c72656164792060448201527f616374697665000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60008054610100900460ff16156105cf576105c982610c25565b92915050565b60005460ff16156105e3576105c982610c4f565b6105c982610cf3565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106ae573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038791906114d7565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa158015610731573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075591906114a1565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461080f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e20736574206973466a6f726420666c61670060648201526084016102fb565b600054610100900460ff16156108a6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f47617350726963654f7261636c653a20466a6f726420616c726561647920616360448201527f746976650000000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106ae573d6000803e3d6000fd5b60008061094183610e47565b60005490915060ff16156109555792915050565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d89190611488565b6109e2908261152c565b9392505050565b60008054610100900460ff16610a81576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f47617350726963654f7261636c653a206765744c314665655570706572426f7560448201527f6e64206f6e6c7920737570706f72747320466a6f72640000000000000000000060648201526084016102fb565b6000610a8e60ff84611573565b610a9890846115db565b610aa39060106115db565b610aae9060446115db565b90506000610abd8460446115db565b9050610ac98282610ed7565b949350505050565b6000805460ff1615610b65576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a207363616c61722829206973206465707260448201527f656361746564000000000000000000000000000000000000000000000000000060648201526084016102fb565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600080610c3183610fe1565b51610c3d90604461152c565b9050600083516044610abd919061152c565b600080610c5b83610e47565b90506000610c676105ec565b610c6f6108d4565b610c7a90601061164f565b63ffffffff16610c8a919061167b565b90506000610c96610bc4565b610c9e61064d565b63ffffffff16610cae919061167b565b90506000610cbc828461152c565b610cc6908561167b565b9050610cd46006600a6117d8565b610cdf90601061167b565b610ce990826117e4565b9695505050505050565b600080610cff83610e47565b9050600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d869190611488565b610d8e6105ec565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ded573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e119190611488565b610e1b908561152c565b610e25919061167b565b610e2f919061167b565b9050610e3d6006600a6117d8565b610ac990826117e4565b80516000908190815b81811015610eca57848181518110610e6a57610e6a6117f8565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016600003610eaa57610ea360048461152c565b9250610eb8565b610eb560108461152c565b92505b80610ec281611827565b915050610e50565b50610ac98261044061152c565b600080610ee2610bc4565b610eea61064d565b63ffffffff16610efa919061167b565b610f026105ec565b610f0a6108d4565b610f1590601061164f565b63ffffffff16610f25919061167b565b610f2f919061152c565b90506000610f5d847ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffea5a861185f565b610f6a86620fbd2661185f565b610f94907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe5f19de6115db565b610f9e91906115db565b90506000811215610fad575060005b610fb96006600261167b565b610fc490600a6117d8565b610fce838361167b565b610fd891906117e4565b95945050505050565b6060611170565b818153600101919050565b600082840393505b838110156109e25782810151828201511860001a1590930292600101610ffb565b825b60208210611068578251611033601f83610fe8565b52602092909201917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09091019060210161101e565b81156109e257825161107d6001840383610fe8565b520160010192915050565b60006001830392505b61010782106110c9576110bb8360ff166110b660fd6110b68760081c60e00189610fe8565b610fe8565b935061010682039150611091565b600782106110f6576110ef8360ff166110b6600785036110b68760081c60e00189610fe8565b90506109e2565b610ac98360ff166110b68560081c8560051b0187610fe8565b61116882820361114c61113c84600081518060001a8160011a60081b178160021a60101b17915050919050565b639e3779b90260131c611fff1690565b8060021b6040510182815160e01c1860e01b8151188152505050565b600101919050565b6180003860405139618000604051016020830180600d8551820103826002015b818110156112a3576000805b50508051604051600082901a600183901a60081b1760029290921a60101b91909117639e3779b9810260111c617ffc16909101805160e081811c878603811890911b909118909152840190818303908484106111f85750611233565b600184019350611fff821161122d578251600081901a600182901a60081b1760029190911a60101b17810361122d5750611233565b5061119c565b8383106112415750506112a3565b6001830392508583111561125f5761125c878788860361101c565b96505b611273600985016003850160038501610ff3565b9150611280878284611088565b965050611298846112938684860161110f565b61110f565b915050809350611190565b50506112b5838384885185010361101c565b925050506040519150618000820180820391508183526020830160005b838110156112ea5782810151828201526020016112d2565b506000920191825250602001604052919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561133f57600080fd5b813567ffffffffffffffff8082111561135757600080fd5b818401915084601f83011261136b57600080fd5b81358181111561137d5761137d6112fe565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156113c3576113c36112fe565b816040528281528760208487010111156113dc57600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b818110156114295785810183015185820160400152820161140d565b8181111561143b576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60006020828403121561148157600080fd5b5035919050565b60006020828403121561149a57600080fd5b5051919050565b6000602082840312156114b357600080fd5b815173ffffffffffffffffffffffffffffffffffffffff811681146109e257600080fd5b6000602082840312156114e957600080fd5b815163ffffffff811681146109e257600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561153f5761153f6114fd565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261158257611582611544565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f8000000000000000000000000000000000000000000000000000000000000000831416156115d6576115d66114fd565b500590565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03841381151615611615576116156114fd565b827f8000000000000000000000000000000000000000000000000000000000000000038412811615611649576116496114fd565b50500190565b600063ffffffff80831681851681830481118215151615611672576116726114fd565b02949350505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156116b3576116b36114fd565b500290565b600181815b8085111561171157817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156116f7576116f76114fd565b8085161561170457918102915b93841c93908002906116bd565b509250929050565b600082611728575060016105c9565b81611735575060006105c9565b816001811461174b576002811461175557611771565b60019150506105c9565b60ff841115611766576117666114fd565b50506001821b6105c9565b5060208310610133831016604e8410600b8410161715611794575081810a6105c9565b61179e83836116b8565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156117d0576117d06114fd565b029392505050565b60006109e28383611719565b6000826117f3576117f3611544565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611858576118586114fd565b5060010190565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000841360008413858304851182821616156118a0576118a06114fd565b7f800000000000000000000000000000000000000000000000000000000000000060008712868205881281841616156118db576118db6114fd565b600087129250878205871284841616156118f7576118f76114fd565b8785058712818416161561190d5761190d6114fd565b50505092909302939250505056fea164736f6c634300080f000a", + Bin: "0x608060405234801561001057600080fd5b50611bfe806100206000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80636ef25c3a116100b2578063de26c4a111610081578063f45e65d811610066578063f45e65d81461025b578063f820614014610263578063fe173b971461020d57600080fd5b8063de26c4a114610235578063f1c7a58b1461024857600080fd5b80636ef25c3a1461020d5780638e98b10614610213578063960e3a231461021b578063c59859181461022d57600080fd5b806349948e0e11610109578063519b4bd3116100ee578063519b4bd31461019f57806354fd4d50146101a757806368d5dca6146101f057600080fd5b806349948e0e1461016f5780634ef6e2241461018257600080fd5b80630c18c1621461013b57806322b90ab3146101565780632e0f262514610160578063313ce56714610168575b600080fd5b61014361026b565b6040519081526020015b60405180910390f35b61015e61038c565b005b610143600681565b6006610143565b61014361017d366004611587565b6105af565b60005461018f9060ff1681565b604051901515815260200161014d565b61014361061c565b6101e36040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b60405161014d91906116c1565b6101f861067d565b60405163ffffffff909116815260200161014d565b48610143565b61015e610702565b60005461018f90610100900460ff1681565b6101f8610996565b610143610243366004611587565b6109f7565b6101436102563660046116d4565b610aab565b610143610b93565b610143610c86565b6000805460ff1615610304576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f47617350726963654f7261636c653a206f76657268656164282920697320646560448201527f707265636174656400000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038791906116ed565b905090565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040f9190611706565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e2073657420697345636f746f6e6520666c6160648201527f6700000000000000000000000000000000000000000000000000000000000000608482015260a4016102fb565b60005460ff1615610582576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a2045636f746f6e6520616c72656164792060448201527f616374697665000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60006105e0604051806060016040528060228152602001611bd06022913960005460ff610100820481169116610ce7565b600054610100900460ff16156105ff576105f982610d7f565b92915050565b60005460ff1615610613576105f982610df5565b6105f982610e99565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106de573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610387919061173c565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa158015610761573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107859190611706565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461083f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e20736574206973466a6f726420666c61670060648201526084016102fb565b60005460ff166108d1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f47617350726963654f7261636c653a20466a6f72642063616e206f6e6c79206260448201527f65206163746976617465642061667465722045636f746f6e650000000000000060648201526084016102fb565b600054610100900460ff1615610968576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f47617350726963654f7261636c653a20466a6f726420616c726561647920616360448201527f746976650000000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106de573d6000803e3d6000fd5b600080610a0383610fed565b60005490915060ff1615610a175792915050565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9a91906116ed565b610aa49082611791565b9392505050565b60008054610100900460ff16610b43576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f47617350726963654f7261636c653a206765744c314665655570706572426f7560448201527f6e64206f6e6c7920737570706f72747320466a6f72640000000000000000000060648201526084016102fb565b6000610b5060ff846117d8565b610b5a9084611840565b610b65906010611840565b610b70906044611840565b90506000610b7f846044611840565b9050610b8b828261107d565b949350505050565b6000805460ff1615610c27576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a207363616c61722829206973206465707260448201527f656361746564000000000000000000000000000000000000000000000000000060648201526084016102fb565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b610d7a838383604051602401610cff939291906118b4565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f850b7ad600000000000000000000000000000000000000000000000000000000179052611187565b505050565b600080610d8b836111a8565b51610d97906044611791565b9050600083516044610da99190611791565b9050610deb6040518060400160405280601a81526020017f666173746c7a53697a653a2025732c20747853697a653a20257300000000000081525083836114c5565b610b8b828261107d565b600080610e0183610fed565b90506000610e0d61061c565b610e15610996565b610e209060106118de565b63ffffffff16610e30919061190a565b90506000610e3c610c86565b610e4461067d565b63ffffffff16610e54919061190a565b90506000610e628284611791565b610e6c908561190a565b9050610e7a6006600a611a67565b610e8590601061190a565b610e8f9082611a73565b9695505050505050565b600080610ea583610fed565b9050600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2c91906116ed565b610f3461061c565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb791906116ed565b610fc19085611791565b610fcb919061190a565b610fd5919061190a565b9050610fe36006600a611a67565b610b8b9082611a73565b80516000908190815b818110156110705784818151811061101057611010611a87565b01602001517fff000000000000000000000000000000000000000000000000000000000000001660000361105057611049600484611791565b925061105e565b61105b601084611791565b92505b8061106881611ab6565b915050610ff6565b50610b8b82610440611791565b600080611088610c86565b61109061067d565b63ffffffff166110a0919061190a565b6110a861061c565b6110b0610996565b6110bb9060106118de565b63ffffffff166110cb919061190a565b6110d59190611791565b90506000611103847ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffea5a8611aee565b61111086620fbd26611aee565b61113a907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe5f19de611840565b6111449190611840565b90506000811215611153575060005b61115f6006600261190a565b61116a90600a611a67565b611174838361190a565b61117e9190611a73565b95945050505050565b80516a636f6e736f6c652e6c6f67602083016000808483855afa5050505050565b6060611337565b818153600101919050565b600082840393505b83811015610aa45782810151828201511860001a15909302926001016111c2565b825b6020821061122f5782516111fa601f836111af565b52602092909201917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909101906021016111e5565b8115610aa457825161124460018403836111af565b520160010192915050565b60006001830392505b6101078210611290576112828360ff1661127d60fd61127d8760081c60e001896111af565b6111af565b935061010682039150611258565b600782106112bd576112b68360ff1661127d6007850361127d8760081c60e001896111af565b9050610aa4565b610b8b8360ff1661127d8560081c8560051b01876111af565b61132f82820361131361130384600081518060001a8160011a60081b178160021a60101b17915050919050565b639e3779b90260131c611fff1690565b8060021b6040510182815160e01c1860e01b8151188152505050565b600101919050565b6180003860405139618000604051016020830180600d8551820103826002015b8181101561146a576000805b50508051604051600082901a600183901a60081b1760029290921a60101b91909117639e3779b9810260111c617ffc16909101805160e081811c878603811890911b909118909152840190818303908484106113bf57506113fa565b600184019350611fff82116113f4578251600081901a600182901a60081b1760029190911a60101b1781036113f457506113fa565b50611363565b83831061140857505061146a565b600183039250858311156114265761142387878886036111e3565b96505b61143a6009850160038501600385016111ba565b915061144787828461124f565b96505061145f8461145a868486016112d6565b6112d6565b915050809350611357565b505061147c83838488518501036111e3565b925050506040519150618000820180820391508183526020830160005b838110156114b1578281015182820152602001611499565b506000920191825250602001604052919050565b610d7a8383836040516024016114dd93929190611baa565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f969cdd0300000000000000000000000000000000000000000000000000000000179052611187565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561159957600080fd5b813567ffffffffffffffff808211156115b157600080fd5b818401915084601f8301126115c557600080fd5b8135818111156115d7576115d7611558565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561161d5761161d611558565b8160405282815287602084870101111561163657600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000815180845260005b8181101561167c57602081850181015186830182015201611660565b8181111561168e576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610aa46020830184611656565b6000602082840312156116e657600080fd5b5035919050565b6000602082840312156116ff57600080fd5b5051919050565b60006020828403121561171857600080fd5b815173ffffffffffffffffffffffffffffffffffffffff81168114610aa457600080fd5b60006020828403121561174e57600080fd5b815163ffffffff81168114610aa457600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082198211156117a4576117a4611762565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826117e7576117e76117a9565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f80000000000000000000000000000000000000000000000000000000000000008314161561183b5761183b611762565b500590565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0384138115161561187a5761187a611762565b827f80000000000000000000000000000000000000000000000000000000000000000384128116156118ae576118ae611762565b50500190565b6060815260006118c76060830186611656565b931515602083015250901515604090910152919050565b600063ffffffff8083168185168183048111821515161561190157611901611762565b02949350505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561194257611942611762565b500290565b600181815b808511156119a057817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561198657611986611762565b8085161561199357918102915b93841c939080029061194c565b509250929050565b6000826119b7575060016105f9565b816119c4575060006105f9565b81600181146119da57600281146119e457611a00565b60019150506105f9565b60ff8411156119f5576119f5611762565b50506001821b6105f9565b5060208310610133831016604e8410600b8410161715611a23575081810a6105f9565b611a2d8383611947565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115611a5f57611a5f611762565b029392505050565b6000610aa483836119a8565b600082611a8257611a826117a9565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611ae757611ae7611762565b5060010190565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600084136000841385830485118282161615611b2f57611b2f611762565b7f80000000000000000000000000000000000000000000000000000000000000006000871286820588128184161615611b6a57611b6a611762565b60008712925087820587128484161615611b8657611b86611762565b87850587128184161615611b9c57611b9c611762565b505050929093029392505050565b606081526000611bbd6060830186611656565b6020830194909452506040015291905056fe64616e79616c3a206973466a6f72643a2025732c20697345636f746f6e653a202573a164736f6c634300080f000a", } // GasPriceOracleABI is the input ABI used to generate the binding from. diff --git a/op-e2e/Makefile b/op-e2e/Makefile index d730a7c23f8..e306654b5d9 100644 --- a/op-e2e/Makefile +++ b/op-e2e/Makefile @@ -64,3 +64,7 @@ clean: rm -r ../.devnet rm -r ../op-program/bin .PHONY: clean + +fuzz: + go test -ldflags=-extldflags=-Wl,-ld_classic -run NOTAREALTEST -v -fuzztime 60s -fuzz FuzzFastLz ./actions +.PHONY: fuzz diff --git a/op-e2e/actions/fjord_fork_test.go b/op-e2e/actions/fjord_fork_test.go index d47d9dc3a5d..88794f66241 100644 --- a/op-e2e/actions/fjord_fork_test.go +++ b/op-e2e/actions/fjord_fork_test.go @@ -125,6 +125,53 @@ func TestFjordNetworkUpgradeTransactions(gt *testing.T) { require.Equal(t, upperBoundCost.Uint64(), upperBound.Uint64()) } +func FuzzFastLz(f *testing.F) { + f.Fuzz(func(gt *testing.T, data []byte) { + if len(data) <= 71 { + return + } + + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + genesisBlock := hexutil.Uint64(0) + + dp.DeployConfig.L1CancunTimeOffset = &genesisBlock // can be removed once Cancun on L1 is the default + + // Activate all forks at genesis, and schedule Fjord the block after + dp.DeployConfig.L2GenesisRegolithTimeOffset = &genesisBlock + dp.DeployConfig.L2GenesisCanyonTimeOffset = &genesisBlock + dp.DeployConfig.L2GenesisDeltaTimeOffset = &genesisBlock + dp.DeployConfig.L2GenesisEcotoneTimeOffset = &genesisBlock + dp.DeployConfig.L2GenesisFjordTimeOffset = &genesisBlock + + require.NoError(t, dp.DeployConfig.Check(), "must have valid config") + + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LvlDebug) + _, _, _, sequencer, engine, verifier, _, _ := setupReorgTestActors(t, dp, sd, log) + ethCl := engine.EthClient() + + // start op-nodes + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // Build to the Fjord block + sequencer.ActBuildL2ToFjord(t) + + // Get gas price from oracle + gasPriceOracle, err := bindings.NewGasPriceOracleCaller(predeploys.GasPriceOracleAddr, ethCl) + require.NoError(t, err) + + used, err := gasPriceOracle.GetL1Fee(&bind.CallOpts{}, data) + require.NoError(t, err) + + fastLzLength := types.FlzCompressLen(data) + cost := fjordL1Cost(t, gasPriceOracle, int64(fastLzLength), int64(len(data))) + + require.Equal(t, cost.Uint64(), used.Uint64()) + }) +} + // The new cost function: // l1BaseFeeScaled = l1BaseFeeScalar * l1BaseFee * 16 // l1BlobFeeScaled = l1BlobFeeScalar * l1BlobBaseFee diff --git a/op-service/sources/l1_beacon_client.go b/op-service/sources/l1_beacon_client.go index a940f27a898..887ea1a196f 100644 --- a/op-service/sources/l1_beacon_client.go +++ b/op-service/sources/l1_beacon_client.go @@ -231,6 +231,7 @@ func (cl *L1BeaconClient) GetBlobSidecars(ctx context.Context, ref eth.L1BlockRe if err != nil { return nil, fmt.Errorf("failed to get time to slot function: %w", err) } + // block time could have been wrong slot, err := slotFn(ref.Time) if err != nil { return nil, fmt.Errorf("error in converting ref.Time to slot: %w", err) From 027b68ccf05a03f4ed7368c5db7629b6e0a24c39 Mon Sep 17 00:00:00 2001 From: Danyal Prout Date: Sat, 27 Apr 2024 22:18:04 -0500 Subject: [PATCH 05/14] update to 1d model / add tests --- .circleci/config.yml | 5 - CONTRIBUTING.md | 2 +- op-e2e/Makefile | 4 - op-e2e/actions/fjord_fork_test.go | 97 ++++--------- op-e2e/gas_price_oracle_test.go | 135 ------------------ .../derive/fjord_upgrade_transactions.go | 4 +- .../derive/fjord_upgrade_transactions_test.go | 7 +- op-node/rollup/derive/l1_block_info.go | 1 - op-service/eth/types.go | 4 - op-service/sources/l1_beacon_client.go | 1 - 10 files changed, 34 insertions(+), 226 deletions(-) delete mode 100644 op-e2e/gas_price_oracle_test.go diff --git a/.circleci/config.yml b/.circleci/config.yml index fbcc1a3186e..a98a8a8672e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1758,11 +1758,6 @@ workflows: on_changes: cannon,packages/contracts-bedrock/src/cannon uses_artifacts: true requires: ["go-mod-download", "pnpm-monorepo"] - - fuzz-golang: - name: op-e2e-fuzz - package_name: op-e2e - on_changes: op-e2e,packages/contracts-bedrock/src/ - requires: [ "go-mod-download" ] - go-test: name: op-heartbeat-tests module: op-heartbeat diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 09dba3ad11f..c854c6eb91e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -68,7 +68,7 @@ You'll need the following: * [pnpm](https://pnpm.io/installation) * [Docker](https://docs.docker.com/get-docker/) * [Docker Compose](https://docs.docker.com/compose/install/) -* [Go](h0ttps://go.dev/dl/) +* [Go](https://go.dev/dl/) * [Foundry](https://getfoundry.sh) * [jq](https://jqlang.github.io/jq/) * [go-ethereum](https://github.com/ethereum/go-ethereum) diff --git a/op-e2e/Makefile b/op-e2e/Makefile index e306654b5d9..d730a7c23f8 100644 --- a/op-e2e/Makefile +++ b/op-e2e/Makefile @@ -64,7 +64,3 @@ clean: rm -r ../.devnet rm -r ../op-program/bin .PHONY: clean - -fuzz: - go test -ldflags=-extldflags=-Wl,-ld_classic -run NOTAREALTEST -v -fuzztime 60s -fuzz FuzzFastLz ./actions -.PHONY: fuzz diff --git a/op-e2e/actions/fjord_fork_test.go b/op-e2e/actions/fjord_fork_test.go index 88794f66241..518aa9b61c5 100644 --- a/op-e2e/actions/fjord_fork_test.go +++ b/op-e2e/actions/fjord_fork_test.go @@ -23,20 +23,20 @@ import ( ) var ( - fjordGasPriceOracleCodeHash = common.HexToHash("0x9ceff82dc9f9bf592dc3954dde0ce8466864229caa8916fffc4005e2fde3d589") + fjordGasPriceOracleCodeHash = common.HexToHash("0xd932e30ee61cd4af3aa471df75293d2c4c3da7aac54ca3bfd5e0b65f4d7f5fa5") // https://basescan.org/tx/0x8debb2fe54200183fb8baa3c6dbd8e6ec2e4f7a4add87416cd60336b8326d16a txHex = "02f875822105819b8405709fb884057d460082e97f94273ca93a52b817294830ed7572aa591ccfa647fd80881249c58b0021fb3fc080a05bb08ccfd68f83392e446dac64d88a2d28e7072c06502dfabc4a77e77b5c7913a05878d53dd4ebba4f6367e572d524dffcabeec3abb1d8725ee3ac5dc32e1852e3" - costTxSizeCoef int64 = -88_664 - costFastlzCoef int64 = 1_031_462 - costIntercept int64 = -27_321_890 + costFastlzCoef int64 = 836_500 + costIntercept int64 = -42_585_600 ) func TestFjordNetworkUpgradeTransactions(gt *testing.T) { t := NewDefaultTesting(gt) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) genesisBlock := hexutil.Uint64(0) - fjordOffset := hexutil.Uint64(2) + ecotoneOffset := hexutil.Uint64(4) + fjordOffset := hexutil.Uint64(8) dp.DeployConfig.L1CancunTimeOffset = &genesisBlock // can be removed once Cancun on L1 is the default @@ -44,9 +44,8 @@ func TestFjordNetworkUpgradeTransactions(gt *testing.T) { dp.DeployConfig.L2GenesisRegolithTimeOffset = &genesisBlock dp.DeployConfig.L2GenesisCanyonTimeOffset = &genesisBlock dp.DeployConfig.L2GenesisDeltaTimeOffset = &genesisBlock - dp.DeployConfig.L2GenesisEcotoneTimeOffset = &genesisBlock + dp.DeployConfig.L2GenesisEcotoneTimeOffset = &ecotoneOffset dp.DeployConfig.L2GenesisFjordTimeOffset = &fjordOffset - require.NoError(t, dp.DeployConfig.Check(), "must have valid config") sd := e2eutils.Setup(t, dp, defaultAlloc) @@ -54,19 +53,24 @@ func TestFjordNetworkUpgradeTransactions(gt *testing.T) { _, _, _, sequencer, engine, verifier, _, _ := setupReorgTestActors(t, dp, sd, log) ethCl := engine.EthClient() + // build a single block to move away from the genesis with 0-values in L1Block contract + sequencer.ActL2StartBlock(t) + sequencer.ActL2EndBlock(t) + // start op-nodes sequencer.ActL2PipelineFull(t) verifier.ActL2PipelineFull(t) - // Get current implementations addresses (by slot) for L1Block + GasPriceOracle - initialGasPriceOracleAddress, err := ethCl.StorageAt(context.Background(), predeploys.GasPriceOracleAddr, genesis.ImplementationSlot, nil) - require.NoError(t, err) - // Get gas price from oracle gasPriceOracle, err := bindings.NewGasPriceOracleCaller(predeploys.GasPriceOracleAddr, ethCl) require.NoError(t, err) - // Build to the Fjord block + sequencer.ActBuildL2ToEcotone(t) + + // Get current implementations addresses (by slot) for L1Block + GasPriceOracle + initialGasPriceOracleAddress, err := ethCl.StorageAt(context.Background(), predeploys.GasPriceOracleAddr, genesis.ImplementationSlot, nil) + require.NoError(t, err) + sequencer.ActBuildL2ToFjord(t) // get latest block @@ -102,17 +106,21 @@ func TestFjordNetworkUpgradeTransactions(gt *testing.T) { require.NoError(t, err) require.True(t, isFjord) - // Check GetL1Fee is updated + // Check GetL1GasUsed is updated txData, err := hex.DecodeString(txHex) require.NoError(t, err) - used, err := gasPriceOracle.GetL1Fee(&bind.CallOpts{}, txData) + l1GasUsed, err := gasPriceOracle.GetL1GasUsed(&bind.CallOpts{}, txData) require.NoError(t, err) - fastLzLength := types.FlzCompressLen(txData) + fastLzSize := types.FlzCompressLen(txData) + require.Equal(gt, l1GasUsed.Uint64(), uint64(fastLzSize+68)*16) - cost := fjordL1Cost(t, gasPriceOracle, int64(fastLzLength), int64(len(txData))) + // Check that GetL1Fee takes into account fast LZ + used, err := gasPriceOracle.GetL1Fee(&bind.CallOpts{}, txData) + require.NoError(t, err) + cost := fjordL1Cost(t, gasPriceOracle, int64(fastLzSize)) require.Equal(t, cost.Uint64(), used.Uint64()) // Check that L1FeeUppberBound works @@ -121,68 +129,22 @@ func TestFjordNetworkUpgradeTransactions(gt *testing.T) { flzUpperBound := len(txData) + len(txData)/255 + 16 - upperBoundCost := fjordL1Cost(t, gasPriceOracle, int64(flzUpperBound), int64(len(txData))) + upperBoundCost := fjordL1Cost(t, gasPriceOracle, int64(flzUpperBound)) require.Equal(t, upperBoundCost.Uint64(), upperBound.Uint64()) } -func FuzzFastLz(f *testing.F) { - f.Fuzz(func(gt *testing.T, data []byte) { - if len(data) <= 71 { - return - } - - t := NewDefaultTesting(gt) - dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) - genesisBlock := hexutil.Uint64(0) - - dp.DeployConfig.L1CancunTimeOffset = &genesisBlock // can be removed once Cancun on L1 is the default - - // Activate all forks at genesis, and schedule Fjord the block after - dp.DeployConfig.L2GenesisRegolithTimeOffset = &genesisBlock - dp.DeployConfig.L2GenesisCanyonTimeOffset = &genesisBlock - dp.DeployConfig.L2GenesisDeltaTimeOffset = &genesisBlock - dp.DeployConfig.L2GenesisEcotoneTimeOffset = &genesisBlock - dp.DeployConfig.L2GenesisFjordTimeOffset = &genesisBlock - - require.NoError(t, dp.DeployConfig.Check(), "must have valid config") - - sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) - _, _, _, sequencer, engine, verifier, _, _ := setupReorgTestActors(t, dp, sd, log) - ethCl := engine.EthClient() - - // start op-nodes - sequencer.ActL2PipelineFull(t) - verifier.ActL2PipelineFull(t) - - // Build to the Fjord block - sequencer.ActBuildL2ToFjord(t) - - // Get gas price from oracle - gasPriceOracle, err := bindings.NewGasPriceOracleCaller(predeploys.GasPriceOracleAddr, ethCl) - require.NoError(t, err) - - used, err := gasPriceOracle.GetL1Fee(&bind.CallOpts{}, data) - require.NoError(t, err) - - fastLzLength := types.FlzCompressLen(data) - cost := fjordL1Cost(t, gasPriceOracle, int64(fastLzLength), int64(len(data))) - - require.Equal(t, cost.Uint64(), used.Uint64()) - }) -} - // The new cost function: // l1BaseFeeScaled = l1BaseFeeScalar * l1BaseFee * 16 // l1BlobFeeScaled = l1BlobFeeScalar * l1BlobBaseFee // l1FeeScaled = l1BaseFeeScaled + l1BlobFeeScaled -// ((intercept + fastlzCoef*fastlzLength + uncompressedTxCoef*uncompressedTxSize) * l1FeeScaled) / 1e12 +// ((intercept + fastlzCoef*max(fastlzLength, 71)) * l1FeeScaled) / 1e6 func fjordL1Cost( t require.TestingT, gasPriceOracle *bindings.GasPriceOracleCaller, - fastLzLength, - unsignedTxSize int64, + fastLzLength int64, ) *big.Int { + fastLzLength = max(fastLzLength, 71) + baseFeeScalar, err := gasPriceOracle.BaseFeeScalar(nil) require.NoError(t, err) l1BaseFee, err := gasPriceOracle.L1BaseFee(nil) @@ -198,7 +160,6 @@ func fjordL1Cost( cost := new(big.Int).Mul(new(big.Int).SetInt64(costFastlzCoef), new(big.Int).SetInt64(fastLzLength+68)) cost = new(big.Int).Add(cost, new(big.Int).SetInt64(costIntercept)) - cost = new(big.Int).Add(cost, new(big.Int).Mul(new(big.Int).SetInt64(costTxSizeCoef), new(big.Int).SetInt64(unsignedTxSize+68))) require.True(t, cost.Sign() >= 0) cost = new(big.Int).Mul(cost, feeScaled) diff --git a/op-e2e/gas_price_oracle_test.go b/op-e2e/gas_price_oracle_test.go deleted file mode 100644 index 47c6a589af8..00000000000 --- a/op-e2e/gas_price_oracle_test.go +++ /dev/null @@ -1,135 +0,0 @@ -package op_e2e - -import ( - "encoding/binary" - "encoding/hex" - "fmt" - "io/fs" - "math/big" - "os" - "path/filepath" - "testing" - - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/stretchr/testify/assert" - - "github.com/ethereum-optimism/optimism/op-bindings/bindings" - "github.com/ethereum-optimism/optimism/op-bindings/predeploys" -) - -func inputsToHex(inputs []interface{}) ([]byte, error) { - resultBytes := []byte{} - for _, input := range inputs { - switch v := input.(type) { - case int32: - bytes := make([]byte, 4) - binary.BigEndian.PutUint32(bytes, uint32(v)) - resultBytes = append(resultBytes, bytes...) - case uint32: - bytes := make([]byte, 4) - binary.BigEndian.PutUint32(bytes, v) - resultBytes = append(resultBytes, bytes...) - case uint64: - bytes := make([]byte, 8) - binary.BigEndian.PutUint64(bytes, v) - resultBytes = append(resultBytes, bytes...) - default: - return nil, fmt.Errorf("unsupported type: %T", v) - } - } - // Print the hex-encoded string of 28 bytes - return resultBytes, nil -} - -func TestGasPriceOracle(t *testing.T) { - - var ( - sequenceNumber uint64 = 0 - blobFeeScalar uint32 = 1_250_000 - baseFeeScalar uint32 = 11_111 - costTxSizeCoef int32 = -88_664 - costFastlzCoef int32 = 1_031_462 - costIntercept int32 = -27_321_890 - ) - - inputs := []interface{}{baseFeeScalar, blobFeeScalar, sequenceNumber} - payload, err := inputsToHex(inputs) - assert.NoError(t, err) - - byteResult := append(make([]byte, 4), payload...) - - backend := backends.NewSimulatedBackend(map[common.Address]core.GenesisAccount{ - predeploys.GasPriceOracleAddr: { - Code: common.FromHex(bindings.GasPriceOracleDeployedBin), - Balance: big.NewInt(0), - Storage: map[common.Hash]common.Hash{ - common.HexToHash("0x0"): common.HexToHash("0x0101"), // isEcotone = true, isFjord = true - }, - }, - predeploys.L1BlockAddr: { - Code: common.FromHex(bindings.L1BlockDeployedBin), - Balance: big.NewInt(0), - Storage: map[common.Hash]common.Hash{ - common.HexToHash("0x1"): common.HexToHash("0x01"), // l1BaseFee 1 - common.HexToHash("0x3"): common.HexToHash(hex.EncodeToString(byteResult)), // all other constants - common.HexToHash("0x7"): common.HexToHash("0x01"), // l1BlobBaseFee 1 - }, - }, - }, math.MaxUint64) - - caller, err := bindings.NewGasPriceOracleCaller(predeploys.GasPriceOracleAddr, backend) - assert.NoError(t, err) - - atLeastOnce := false - err = filepath.WalkDir("../specs", func(path string, d fs.DirEntry, err error) error { - if d.IsDir() { - return nil - } - b, err := os.ReadFile(path) - if err != nil { - return err - } - - used, err := caller.GetL1Fee(&bind.CallOpts{}, b) - if err != nil { - return err - } - - l1BaseFee, err := caller.L1BaseFee(&bind.CallOpts{}) - - if err != nil { - return err - } - - l1BaseFeeScaled := uint64(baseFeeScalar) * l1BaseFee.Uint64() * 16 - l1BlobBaseFee, err := caller.BlobBaseFee(&bind.CallOpts{}) - if err != nil { - return err - } - - l1BlobFeeScaled := uint64(blobFeeScalar) * l1BlobBaseFee.Uint64() - l1FeeScaled := l1BaseFeeScaled + l1BlobFeeScaled - fastLzLength := types.FlzCompressLen(b) - txSize := len(b) + 68 - expected := ((int64(costIntercept) + int64(costFastlzCoef)*int64(fastLzLength+68) + int64(costTxSizeCoef)*int64(txSize)) * int64(l1FeeScaled)) / 1e12 - assert.Equal(t, uint64(expected), used.Uint64(), path) - - upperBound, err := caller.GetL1FeeUpperBound(&bind.CallOpts{}, big.NewInt(int64(len(b)))) - if err != nil { - return err - } - flzUpperBound := txSize + txSize/255 + 16 - expectedFeeUpperBound := ((int64(costIntercept) + int64(costFastlzCoef)*int64(flzUpperBound) + int64(costTxSizeCoef)*int64(txSize)) * int64(l1FeeScaled)) / 1e12 - assert.Equal(t, uint64(expectedFeeUpperBound), upperBound.Uint64(), path) - - atLeastOnce = true - return nil - }) - assert.NoError(t, err) - assert.True(t, atLeastOnce) -} diff --git a/op-node/rollup/derive/fjord_upgrade_transactions.go b/op-node/rollup/derive/fjord_upgrade_transactions.go index 530fed257bb..ccde9c1b6a1 100644 --- a/op-node/rollup/derive/fjord_upgrade_transactions.go +++ b/op-node/rollup/derive/fjord_upgrade_transactions.go @@ -15,7 +15,7 @@ var ( // Gas Price Oracle Parameters deployFjordGasPriceOracleSource = UpgradeDepositSource{Intent: "Fjord: Gas Price Oracle Deployment"} GasPriceOracleFjordDeployerAddress = common.HexToAddress("0x4210000000000000000000000000000000000002") - gasPriceOracleFjordDeploymentBytecode = common.FromHex("0x608060405234801561001057600080fd5b50611928806100206000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80636ef25c3a116100b2578063de26c4a111610081578063f45e65d811610066578063f45e65d81461025b578063f820614014610263578063fe173b971461020d57600080fd5b8063de26c4a114610235578063f1c7a58b1461024857600080fd5b80636ef25c3a1461020d5780638e98b10614610213578063960e3a231461021b578063c59859181461022d57600080fd5b806349948e0e11610109578063519b4bd3116100ee578063519b4bd31461019f57806354fd4d50146101a757806368d5dca6146101f057600080fd5b806349948e0e1461016f5780634ef6e2241461018257600080fd5b80630c18c1621461013b57806322b90ab3146101565780632e0f262514610160578063313ce56714610168575b600080fd5b61014361026b565b6040519081526020015b60405180910390f35b61015e61038c565b005b610143600681565b6006610143565b61014361017d36600461132d565b6105af565b60005461018f9060ff1681565b604051901515815260200161014d565b6101436105ec565b6101e36040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b60405161014d91906113fc565b6101f861064d565b60405163ffffffff909116815260200161014d565b48610143565b61015e6106d2565b60005461018f90610100900460ff1681565b6101f86108d4565b61014361024336600461132d565b610935565b61014361025636600461146f565b6109e9565b610143610ad1565b610143610bc4565b6000805460ff1615610304576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f47617350726963654f7261636c653a206f76657268656164282920697320646560448201527f707265636174656400000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611488565b905090565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040f91906114a1565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e2073657420697345636f746f6e6520666c6160648201527f6700000000000000000000000000000000000000000000000000000000000000608482015260a4016102fb565b60005460ff1615610582576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a2045636f746f6e6520616c72656164792060448201527f616374697665000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60008054610100900460ff16156105cf576105c982610c25565b92915050565b60005460ff16156105e3576105c982610c4f565b6105c982610cf3565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106ae573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038791906114d7565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa158015610731573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075591906114a1565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461080f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e20736574206973466a6f726420666c61670060648201526084016102fb565b600054610100900460ff16156108a6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f47617350726963654f7261636c653a20466a6f726420616c726561647920616360448201527f746976650000000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106ae573d6000803e3d6000fd5b60008061094183610e47565b60005490915060ff16156109555792915050565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d89190611488565b6109e2908261152c565b9392505050565b60008054610100900460ff16610a81576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f47617350726963654f7261636c653a206765744c314665655570706572426f7560448201527f6e64206f6e6c7920737570706f72747320466a6f72640000000000000000000060648201526084016102fb565b6000610a8e60ff84611573565b610a9890846115db565b610aa39060106115db565b610aae9060446115db565b90506000610abd8460446115db565b9050610ac98282610ed7565b949350505050565b6000805460ff1615610b65576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a207363616c61722829206973206465707260448201527f656361746564000000000000000000000000000000000000000000000000000060648201526084016102fb565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600080610c3183610fe1565b51610c3d90604461152c565b9050600083516044610abd919061152c565b600080610c5b83610e47565b90506000610c676105ec565b610c6f6108d4565b610c7a90601061164f565b63ffffffff16610c8a919061167b565b90506000610c96610bc4565b610c9e61064d565b63ffffffff16610cae919061167b565b90506000610cbc828461152c565b610cc6908561167b565b9050610cd46006600a6117d8565b610cdf90601061167b565b610ce990826117e4565b9695505050505050565b600080610cff83610e47565b9050600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d869190611488565b610d8e6105ec565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ded573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e119190611488565b610e1b908561152c565b610e25919061167b565b610e2f919061167b565b9050610e3d6006600a6117d8565b610ac990826117e4565b80516000908190815b81811015610eca57848181518110610e6a57610e6a6117f8565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016600003610eaa57610ea360048461152c565b9250610eb8565b610eb560108461152c565b92505b80610ec281611827565b915050610e50565b50610ac98261044061152c565b600080610ee2610bc4565b610eea61064d565b63ffffffff16610efa919061167b565b610f026105ec565b610f0a6108d4565b610f1590601061164f565b63ffffffff16610f25919061167b565b610f2f919061152c565b90506000610f5d847ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffea5a861185f565b610f6a86620fbd2661185f565b610f94907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe5f19de6115db565b610f9e91906115db565b90506000811215610fad575060005b610fb96006600261167b565b610fc490600a6117d8565b610fce838361167b565b610fd891906117e4565b95945050505050565b6060611170565b818153600101919050565b600082840393505b838110156109e25782810151828201511860001a1590930292600101610ffb565b825b60208210611068578251611033601f83610fe8565b52602092909201917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09091019060210161101e565b81156109e257825161107d6001840383610fe8565b520160010192915050565b60006001830392505b61010782106110c9576110bb8360ff166110b660fd6110b68760081c60e00189610fe8565b610fe8565b935061010682039150611091565b600782106110f6576110ef8360ff166110b6600785036110b68760081c60e00189610fe8565b90506109e2565b610ac98360ff166110b68560081c8560051b0187610fe8565b61116882820361114c61113c84600081518060001a8160011a60081b178160021a60101b17915050919050565b639e3779b90260131c611fff1690565b8060021b6040510182815160e01c1860e01b8151188152505050565b600101919050565b6180003860405139618000604051016020830180600d8551820103826002015b818110156112a3576000805b50508051604051600082901a600183901a60081b1760029290921a60101b91909117639e3779b9810260111c617ffc16909101805160e081811c878603811890911b909118909152840190818303908484106111f85750611233565b600184019350611fff821161122d578251600081901a600182901a60081b1760029190911a60101b17810361122d5750611233565b5061119c565b8383106112415750506112a3565b6001830392508583111561125f5761125c878788860361101c565b96505b611273600985016003850160038501610ff3565b9150611280878284611088565b965050611298846112938684860161110f565b61110f565b915050809350611190565b50506112b5838384885185010361101c565b925050506040519150618000820180820391508183526020830160005b838110156112ea5782810151828201526020016112d2565b506000920191825250602001604052919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561133f57600080fd5b813567ffffffffffffffff8082111561135757600080fd5b818401915084601f83011261136b57600080fd5b81358181111561137d5761137d6112fe565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156113c3576113c36112fe565b816040528281528760208487010111156113dc57600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b818110156114295785810183015185820160400152820161140d565b8181111561143b576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60006020828403121561148157600080fd5b5035919050565b60006020828403121561149a57600080fd5b5051919050565b6000602082840312156114b357600080fd5b815173ffffffffffffffffffffffffffffffffffffffff811681146109e257600080fd5b6000602082840312156114e957600080fd5b815163ffffffff811681146109e257600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561153f5761153f6114fd565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261158257611582611544565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f8000000000000000000000000000000000000000000000000000000000000000831416156115d6576115d66114fd565b500590565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03841381151615611615576116156114fd565b827f8000000000000000000000000000000000000000000000000000000000000000038412811615611649576116496114fd565b50500190565b600063ffffffff80831681851681830481118215151615611672576116726114fd565b02949350505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156116b3576116b36114fd565b500290565b600181815b8085111561171157817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156116f7576116f76114fd565b8085161561170457918102915b93841c93908002906116bd565b509250929050565b600082611728575060016105c9565b81611735575060006105c9565b816001811461174b576002811461175557611771565b60019150506105c9565b60ff841115611766576117666114fd565b50506001821b6105c9565b5060208310610133831016604e8410600b8410161715611794575081810a6105c9565b61179e83836116b8565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156117d0576117d06114fd565b029392505050565b60006109e28383611719565b6000826117f3576117f3611544565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611858576118586114fd565b5060010190565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000841360008413858304851182821616156118a0576118a06114fd565b7f800000000000000000000000000000000000000000000000000000000000000060008712868205881281841616156118db576118db6114fd565b600087129250878205871284841616156118f7576118f76114fd565b8785058712818416161561190d5761190d6114fd565b50505092909302939250505056fea164736f6c634300080f000a") + gasPriceOracleFjordDeploymentBytecode = common.FromHex("0x608060405234801561001057600080fd5b5061187d806100206000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80636ef25c3a116100b2578063de26c4a111610081578063f45e65d811610066578063f45e65d81461025b578063f820614014610263578063fe173b971461020d57600080fd5b8063de26c4a114610235578063f1c7a58b1461024857600080fd5b80636ef25c3a1461020d5780638e98b10614610213578063960e3a231461021b578063c59859181461022d57600080fd5b806349948e0e11610109578063519b4bd3116100ee578063519b4bd31461019f57806354fd4d50146101a757806368d5dca6146101f057600080fd5b806349948e0e1461016f5780634ef6e2241461018257600080fd5b80630c18c1621461013b57806322b90ab3146101565780632e0f262514610160578063313ce56714610168575b600080fd5b61014361026b565b6040519081526020015b60405180910390f35b61015e61038c565b005b610143600681565b6006610143565b61014361017d3660046113ae565b6105af565b60005461018f9060ff1681565b604051901515815260200161014d565b610143610600565b6101e36040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b60405161014d919061147d565b6101f8610661565b60405163ffffffff909116815260200161014d565b48610143565b61015e6106e6565b60005461018f90610100900460ff1681565b6101f861097a565b6101436102433660046113ae565b6109db565b6101436102563660046114f0565b610ac9565b610143610b99565b610143610c8c565b6000805460ff1615610304576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f47617350726963654f7261636c653a206f76657268656164282920697320646560448201527f707265636174656400000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611509565b905090565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040f9190611522565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e2073657420697345636f746f6e6520666c6160648201527f6700000000000000000000000000000000000000000000000000000000000000608482015260a4016102fb565b60005460ff1615610582576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a2045636f746f6e6520616c72656164792060448201527f616374697665000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60008054610100900460ff16156105e3576105dd6105cc83610ced565b516105d8906044611587565b611012565b92915050565b60005460ff16156105f7576105dd826110e0565b6105dd82611184565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106c2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610387919061159f565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa158015610745573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107699190611522565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610823576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e20736574206973466a6f726420666c61670060648201526084016102fb565b60005460ff166108b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f47617350726963654f7261636c653a20466a6f72642063616e206f6e6c79206260448201527f65206163746976617465642061667465722045636f746f6e650000000000000060648201526084016102fb565b600054610100900460ff161561094c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f47617350726963654f7261636c653a20466a6f726420616c726561647920616360448201527f746976650000000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106c2573d6000803e3d6000fd5b60008054610100900460ff1615610a1657610a0b6109f883610ced565b51610a04906044611587565b60476112d8565b6105dd9060106115c5565b6000610a21836112ef565b60005490915060ff1615610a355792915050565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab89190611509565b610ac29082611587565b9392505050565b60008054610100900460ff16610b61576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f47617350726963654f7261636c653a206765744c314665655570706572426f7560448201527f6e64206f6e6c7920737570706f72747320466a6f72640000000000000000000060648201526084016102fb565b6000610b6e60ff84611602565b610b789084611587565b610b83906010611587565b610b8e906044611587565b9050610ac281611012565b6000805460ff1615610c2d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a207363616c61722829206973206465707260448201527f656361746564000000000000000000000000000000000000000000000000000060648201526084016102fb565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b6060610e84565b818153600101919050565b600082840393505b83811015610ac25782810151828201511860001a1590930292600101610d07565b825b60208210610d74578251610d3f601f83610cf4565b52602092909201917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090910190602101610d2a565b8115610ac2578251610d896001840383610cf4565b520160010192915050565b60006001830392505b6101078210610dd557610dc78360ff16610dc260fd610dc28760081c60e00189610cf4565b610cf4565b935061010682039150610d9d565b60078210610e0257610dfb8360ff16610dc260078503610dc28760081c60e00189610cf4565b9050610ac2565b610e1b8360ff16610dc28560081c8560051b0187610cf4565b949350505050565b610e7c828203610e60610e5084600081518060001a8160011a60081b178160021a60101b17915050919050565b639e3779b90260131c611fff1690565b8060021b6040510182815160e01c1860e01b8151188152505050565b600101919050565b6180003860405139618000604051016020830180600d8551820103826002015b81811015610fb7576000805b50508051604051600082901a600183901a60081b1760029290921a60101b91909117639e3779b9810260111c617ffc16909101805160e081811c878603811890911b90911890915284019081830390848410610f0c5750610f47565b600184019350611fff8211610f41578251600081901a600182901a60081b1760029190911a60101b178103610f415750610f47565b50610eb0565b838310610f55575050610fb7565b60018303925085831115610f7357610f708787888603610d28565b96505b610f87600985016003850160038501610cff565b9150610f94878284610d94565b965050610fac84610fa786848601610e23565b610e23565b915050809350610ea4565b5050610fc98383848851850103610d28565b925050506040519150618000820180820391508183526020830160005b83811015610ffe578281015182820152602001610fe6565b506000920191825250602001604052919050565b600061101f8260476112d8565b9150600061102b610c8c565b611033610661565b63ffffffff1661104391906115c5565b61104b610600565b61105361097a565b61105e90601061163d565b63ffffffff1661106e91906115c5565b6110789190611587565b9050600061108984620cc3946115c5565b6110b3907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd763200611669565b90506110c1600660026115c5565b6110cc90600a6117fd565b6110d683836115c5565b610e1b9190611602565b6000806110ec836112ef565b905060006110f8610600565b61110061097a565b61110b90601061163d565b63ffffffff1661111b91906115c5565b90506000611127610c8c565b61112f610661565b63ffffffff1661113f91906115c5565b9050600061114d8284611587565b61115790856115c5565b90506111656006600a6117fd565b6111709060106115c5565b61117a9082611602565b9695505050505050565b600080611190836112ef565b9050600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112179190611509565b61121f610600565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa15801561127e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a29190611509565b6112ac9085611587565b6112b691906115c5565b6112c091906115c5565b90506112ce6006600a6117fd565b610e1b9082611602565b6000818310156112e85781610ac2565b5090919050565b80516000908190815b818110156113725784818151811061131257611312611809565b01602001517fff00000000000000000000000000000000000000000000000000000000000000166000036113525761134b600484611587565b9250611360565b61135d601084611587565b92505b8061136a81611838565b9150506112f8565b50610e1b82610440611587565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156113c057600080fd5b813567ffffffffffffffff808211156113d857600080fd5b818401915084601f8301126113ec57600080fd5b8135818111156113fe576113fe61137f565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156114445761144461137f565b8160405282815287602084870101111561145d57600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b818110156114aa5785810183015185820160400152820161148e565b818111156114bc576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60006020828403121561150257600080fd5b5035919050565b60006020828403121561151b57600080fd5b5051919050565b60006020828403121561153457600080fd5b815173ffffffffffffffffffffffffffffffffffffffff81168114610ac257600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561159a5761159a611558565b500190565b6000602082840312156115b157600080fd5b815163ffffffff81168114610ac257600080fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156115fd576115fd611558565b500290565b600082611638577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600063ffffffff8083168185168183048111821515161561166057611660611558565b02949350505050565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038413811516156116a3576116a3611558565b827f80000000000000000000000000000000000000000000000000000000000000000384128116156116d7576116d7611558565b50500190565b600181815b8085111561173657817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561171c5761171c611558565b8085161561172957918102915b93841c93908002906116e2565b509250929050565b60008261174d575060016105dd565b8161175a575060006105dd565b8160018114611770576002811461177a57611796565b60019150506105dd565b60ff84111561178b5761178b611558565b50506001821b6105dd565b5060208310610133831016604e8410600b84101617156117b9575081810a6105dd565b6117c383836116dd565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156117f5576117f5611558565b029392505050565b6000610ac2838361173e565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361186957611869611558565b506001019056fea164736f6c634300080f000a") // Update GasPricePriceOracle Proxy Parameters updateFjordGasPriceOracleSource = UpgradeDepositSource{Intent: "Fjord: Gas Price Oracle Proxy Update"} @@ -71,7 +71,7 @@ func FjordNetworkUpgradeTransactions() ([]hexutil.Bytes, error) { To: &predeploys.GasPriceOracleAddr, Mint: big.NewInt(0), Value: big.NewInt(0), - Gas: 80_000, + Gas: 90_000, IsSystemTransaction: false, Data: enableFjordInput, }).MarshalBinary() diff --git a/op-node/rollup/derive/fjord_upgrade_transactions_test.go b/op-node/rollup/derive/fjord_upgrade_transactions_test.go index 715b4f0844c..07da4ce4620 100644 --- a/op-node/rollup/derive/fjord_upgrade_transactions_test.go +++ b/op-node/rollup/derive/fjord_upgrade_transactions_test.go @@ -4,10 +4,7 @@ import ( "testing" "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" "github.com/stretchr/testify/require" - - "github.com/ethereum-optimism/optimism/op-bindings/bindings" ) func TestFjordSourcesMatchSpec(t *testing.T) { @@ -42,7 +39,7 @@ func TestFjordNetworkTransactions(t *testing.T) { require.Equal(t, deployFjordGasPriceOracleSource.SourceHash(), deployGasPriceOracle.SourceHash()) require.Nil(t, deployGasPriceOracle.To()) require.Equal(t, uint64(1_450_000), deployGasPriceOracle.Gas()) - require.Equal(t, bindings.GasPriceOracleMetaData.Bin, hexutil.Bytes(deployGasPriceOracle.Data()).String()) + require.Equal(t, gasPriceOracleFjordDeploymentBytecode, deployGasPriceOracle.Data()) updateGasPriceOracleSender, updateGasPriceOracle := toDepositTxn(t, upgradeTxns[1]) require.Equal(t, updateGasPriceOracleSender, common.Address{}) @@ -57,6 +54,6 @@ func TestFjordNetworkTransactions(t *testing.T) { require.Equal(t, enableFjordSource.SourceHash(), gpoSetFjord.SourceHash()) require.NotNil(t, gpoSetFjord.To()) require.Equal(t, *gpoSetFjord.To(), common.HexToAddress("0x420000000000000000000000000000000000000F")) - require.Equal(t, uint64(80_000), gpoSetFjord.Gas()) + require.Equal(t, uint64(90_000), gpoSetFjord.Gas()) require.Equal(t, common.FromHex("0x8e98b106"), gpoSetFjord.Data()) } diff --git a/op-node/rollup/derive/l1_block_info.go b/op-node/rollup/derive/l1_block_info.go index bd44e058e47..93c529750ef 100644 --- a/op-node/rollup/derive/l1_block_info.go +++ b/op-node/rollup/derive/l1_block_info.go @@ -270,7 +270,6 @@ func L1InfoDeposit(rollupCfg *rollup.Config, sysCfg eth.SystemConfig, seqNumber BatcherAddr: sysCfg.BatcherAddr, } var data []byte - if isEcotoneButNotFirstBlock(rollupCfg, l2BlockTime) { l1BlockInfo.BlobBaseFee = block.BlobBaseFee() if l1BlockInfo.BlobBaseFee == nil { diff --git a/op-service/eth/types.go b/op-service/eth/types.go index d7d372ad416..7fe3d3433b4 100644 --- a/op-service/eth/types.go +++ b/op-service/eth/types.go @@ -405,7 +405,6 @@ type FjordScalars struct { BaseFeeScalar uint32 CostIntercept int32 CostFastLzCoef int32 - CostTxSizeCoef int32 } func (sysCfg *SystemConfig) FjordScalars() (FjordScalars, error) { @@ -418,14 +417,12 @@ func (sysCfg *SystemConfig) FjordScalars() (FjordScalars, error) { BaseFeeScalar: math.MaxUint32, CostIntercept: 0, CostFastLzCoef: 0, - CostTxSizeCoef: 0, }, nil } return FjordScalars{}, err } if sysCfg.Scalar[0] == L1ScalarFjord { return FjordScalars{ - CostTxSizeCoef: int32(binary.BigEndian.Uint32(sysCfg.Scalar[12:16])), CostFastLzCoef: int32(binary.BigEndian.Uint32(sysCfg.Scalar[16:20])), CostIntercept: int32(binary.BigEndian.Uint32(sysCfg.Scalar[20:24])), BlobBaseFeeScalar: binary.BigEndian.Uint32(sysCfg.Scalar[24:28]), @@ -442,7 +439,6 @@ func (sysCfg *SystemConfig) FjordScalars() (FjordScalars, error) { BaseFeeScalar: ecotoneScalars.BaseFeeScalar, CostIntercept: 0, CostFastLzCoef: 0, - CostTxSizeCoef: 1_000_000, }, nil } } diff --git a/op-service/sources/l1_beacon_client.go b/op-service/sources/l1_beacon_client.go index 887ea1a196f..a940f27a898 100644 --- a/op-service/sources/l1_beacon_client.go +++ b/op-service/sources/l1_beacon_client.go @@ -231,7 +231,6 @@ func (cl *L1BeaconClient) GetBlobSidecars(ctx context.Context, ref eth.L1BlockRe if err != nil { return nil, fmt.Errorf("failed to get time to slot function: %w", err) } - // block time could have been wrong slot, err := slotFn(ref.Time) if err != nil { return nil, fmt.Errorf("error in converting ref.Time to slot: %w", err) From 15bfbdbd05c4d32d43422b373eac0492c2bd60ad Mon Sep 17 00:00:00 2001 From: Danyal Prout Date: Sun, 28 Apr 2024 19:25:20 -0500 Subject: [PATCH 06/14] update allocs and test framework to support new fjord contracts --- go.mod | 5 +- go.sum | 12 ++--- op-e2e/system_test.go | 51 ++++++++++++++++++- .../contracts-bedrock/scripts/L2Genesis.s.sol | 1 + 4 files changed, 57 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 538a43626c7..505c9445b6c 100644 --- a/go.mod +++ b/go.mod @@ -176,7 +176,6 @@ require ( github.com/multiformats/go-varint v0.0.7 // indirect github.com/naoina/go-stringutil v0.1.0 // indirect github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416 // indirect - github.com/nxadm/tail v1.4.11 // indirect github.com/onsi/ginkgo/v2 v2.15.0 // indirect github.com/opencontainers/runtime-spec v1.1.0 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect @@ -215,8 +214,8 @@ require ( go.uber.org/zap v1.26.0 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.23.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.17.0 // indirect google.golang.org/protobuf v1.32.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/go.sum b/go.sum index f8151ce32a2..41e2a787a42 100644 --- a/go.sum +++ b/go.sum @@ -198,7 +198,6 @@ github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiD github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= @@ -618,9 +617,8 @@ github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= -github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -984,15 +982,14 @@ golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1012,9 +1009,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/op-e2e/system_test.go b/op-e2e/system_test.go index afffad714bc..08e52f2d971 100644 --- a/op-e2e/system_test.go +++ b/op-e2e/system_test.go @@ -1211,6 +1211,18 @@ func TestFees(t *testing.T) { cfg.DeployConfig.L2GenesisEcotoneTimeOffset = new(hexutil.Uint64) testFees(t, cfg) }) + t.Run("fjord", func(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + cfg.DeployConfig.L1GenesisBlockBaseFeePerGas = (*hexutil.Big)(big.NewInt(7)) + + cfg.DeployConfig.L2GenesisRegolithTimeOffset = new(hexutil.Uint64) + cfg.DeployConfig.L2GenesisCanyonTimeOffset = new(hexutil.Uint64) + cfg.DeployConfig.L2GenesisDeltaTimeOffset = new(hexutil.Uint64) + cfg.DeployConfig.L2GenesisEcotoneTimeOffset = new(hexutil.Uint64) + cfg.DeployConfig.L2GenesisFjordTimeOffset = new(hexutil.Uint64) + testFees(t, cfg) + }) } func testFees(t *testing.T, cfg SystemConfig) { @@ -1352,11 +1364,48 @@ func testFees(t *testing.T, cfg SystemConfig) { require.NoError(t, err) require.Equal(t, sys.RollupConfig.IsEcotone(header.Time), gpoEcotone, "GPO and chain must have same ecotone view") + gpoFjord, err := gpoContract.IsFjord(nil) + require.NoError(t, err) + require.Equal(t, sys.RollupConfig.IsFjord(header.Time), gpoFjord, "GPO and chain must have same fjord view") + gpoL1Fee, err := gpoContract.GetL1Fee(&bind.CallOpts{}, bytes) require.Nil(t, err) adjustedGPOFee := gpoL1Fee - if sys.RollupConfig.IsRegolith(header.Time) { + if sys.RollupConfig.IsFjord(header.Time) { + // The tx fastlz size is 102, but the GPO calculation adds extra 68 bytes for the signature + // --- Fjord cost function: --- + // linear regression: -42.5856 + 102 * 0.8365 = 42 + // As this value is below the min txn size of 71, we use 71 for calculating the cost + // --- GPO: --- + // linear regression: -42.5856 + 170 * 0.8365 = 99 + // For GPO the linear regression output is above 71 due to the signature, so we use that instead + // There isn't an easy way to remove the overhead due to clamping. The below is a simple reimplementation + // of the solidity calculation. + + l1BaseFee, err := gpoContract.L1BaseFee(&bind.CallOpts{}) + require.NoError(t, err) + + baseFeeScalar, err := gpoContract.BaseFeeScalar(&bind.CallOpts{}) + require.NoError(t, err) + + blobBaseFeeScalar, err := gpoContract.BlobBaseFeeScalar(&bind.CallOpts{}) + require.NoError(t, err) + + blobBaseFee, err := gpoContract.BlobBaseFee(&bind.CallOpts{}) + require.NoError(t, err) + + feeScaled := new(big.Int).Mul(big.NewInt(int64(baseFeeScalar)), big.NewInt(16)) + feeScaled.Mul(feeScaled, l1BaseFee) + + blobFeeScaled := new(big.Int).Mul(big.NewInt(int64(blobBaseFeeScalar)), blobBaseFee) + feeScaled.Add(feeScaled, blobFeeScaled) + + result := new(big.Int).Mul(big.NewInt(71*1e6), feeScaled) + result.Div(result, big.NewInt(1e12)) + + adjustedGPOFee = result + } else if sys.RollupConfig.IsRegolith(header.Time) { // if post-regolith, adjust the GPO fee by removing the overhead it adds because of signature data artificialGPOOverhead := big.NewInt(68 * 16) // it adds 68 bytes to cover signature and RLP data l1BaseFee := big.NewInt(7) // we assume the L1 basefee is the minimum, 7 diff --git a/packages/contracts-bedrock/scripts/L2Genesis.s.sol b/packages/contracts-bedrock/scripts/L2Genesis.s.sol index 6e12c897923..99bb3a9f13a 100644 --- a/packages/contracts-bedrock/scripts/L2Genesis.s.sol +++ b/packages/contracts-bedrock/scripts/L2Genesis.s.sol @@ -41,6 +41,7 @@ struct L1Dependencies { /// @custom:value LOCAL_LATEST Represents latest L2 allocs, not output anywhere, but kept in-process. /// @custom:value LOCAL_ECOTONE Represents Ecotone-upgrade L2 allocs, not output anywhere, but kept in-process. /// @custom:value LOCAL_DELTA Represents Delta-upgrade L2 allocs, not output anywhere, but kept in-process. +/// @custom:value LOCAL_ECOTONE Represents Ecotone-upgrade L2 allocs, not output anywhere, but kept in-process. /// @custom:value OUTPUT_ALL Represents creation of one L2 allocs file for every upgrade. enum OutputMode { DEFAULT_LATEST, From 41ca0731be02f0125aba4b36a74c7a10c021ce71 Mon Sep 17 00:00:00 2001 From: Danyal Prout Date: Mon, 29 Apr 2024 11:21:13 -0500 Subject: [PATCH 07/14] add fuzz testing --- .circleci/config.yml | 5 + op-bindings/bindings/gaspriceoracle.go | 3 +- op-e2e/Makefile | 4 + op-e2e/external.go | 2 +- op-e2e/external/config.go | 2 +- op-e2e/fastlz_test.go | 176 +++++++++++++++++++++++++ op-e2e/op_geth.go | 2 +- op-e2e/setup.go | 4 +- 8 files changed, 192 insertions(+), 6 deletions(-) create mode 100644 op-e2e/fastlz_test.go diff --git a/.circleci/config.yml b/.circleci/config.yml index a98a8a8672e..ed2df016ab4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1758,6 +1758,11 @@ workflows: on_changes: cannon,packages/contracts-bedrock/src/cannon uses_artifacts: true requires: ["go-mod-download", "pnpm-monorepo"] + - fuzz-golang: + name: op-e2e-fuzz + package_name: op-e2e + on_changes: op-e2e + requires: [ "go-mod-download" ] - go-test: name: op-heartbeat-tests module: op-heartbeat diff --git a/op-bindings/bindings/gaspriceoracle.go b/op-bindings/bindings/gaspriceoracle.go index 9072a349625..2a832f68e76 100644 --- a/op-bindings/bindings/gaspriceoracle.go +++ b/op-bindings/bindings/gaspriceoracle.go @@ -31,7 +31,7 @@ var ( // GasPriceOracleMetaData contains all meta data concerning the GasPriceOracle contract. var GasPriceOracleMetaData = &bind.MetaData{ ABI: "[{\"type\":\"function\",\"name\":\"DECIMALS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"baseFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"baseFeeScalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blobBaseFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blobBaseFeeScalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decimals\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"gasPrice\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getL1Fee\",\"inputs\":[{\"name\":\"_data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getL1FeeUpperBound\",\"inputs\":[{\"name\":\"_unsignedTxSize\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getL1GasUsed\",\"inputs\":[{\"name\":\"_data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isEcotone\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isFjord\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"l1BaseFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"overhead\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"scalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setEcotone\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setFjord\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"}]", - Bin: "0x608060405234801561001057600080fd5b50611bfe806100206000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80636ef25c3a116100b2578063de26c4a111610081578063f45e65d811610066578063f45e65d81461025b578063f820614014610263578063fe173b971461020d57600080fd5b8063de26c4a114610235578063f1c7a58b1461024857600080fd5b80636ef25c3a1461020d5780638e98b10614610213578063960e3a231461021b578063c59859181461022d57600080fd5b806349948e0e11610109578063519b4bd3116100ee578063519b4bd31461019f57806354fd4d50146101a757806368d5dca6146101f057600080fd5b806349948e0e1461016f5780634ef6e2241461018257600080fd5b80630c18c1621461013b57806322b90ab3146101565780632e0f262514610160578063313ce56714610168575b600080fd5b61014361026b565b6040519081526020015b60405180910390f35b61015e61038c565b005b610143600681565b6006610143565b61014361017d366004611587565b6105af565b60005461018f9060ff1681565b604051901515815260200161014d565b61014361061c565b6101e36040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b60405161014d91906116c1565b6101f861067d565b60405163ffffffff909116815260200161014d565b48610143565b61015e610702565b60005461018f90610100900460ff1681565b6101f8610996565b610143610243366004611587565b6109f7565b6101436102563660046116d4565b610aab565b610143610b93565b610143610c86565b6000805460ff1615610304576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f47617350726963654f7261636c653a206f76657268656164282920697320646560448201527f707265636174656400000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038791906116ed565b905090565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040f9190611706565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e2073657420697345636f746f6e6520666c6160648201527f6700000000000000000000000000000000000000000000000000000000000000608482015260a4016102fb565b60005460ff1615610582576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a2045636f746f6e6520616c72656164792060448201527f616374697665000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60006105e0604051806060016040528060228152602001611bd06022913960005460ff610100820481169116610ce7565b600054610100900460ff16156105ff576105f982610d7f565b92915050565b60005460ff1615610613576105f982610df5565b6105f982610e99565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106de573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610387919061173c565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa158015610761573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107859190611706565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461083f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e20736574206973466a6f726420666c61670060648201526084016102fb565b60005460ff166108d1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f47617350726963654f7261636c653a20466a6f72642063616e206f6e6c79206260448201527f65206163746976617465642061667465722045636f746f6e650000000000000060648201526084016102fb565b600054610100900460ff1615610968576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f47617350726963654f7261636c653a20466a6f726420616c726561647920616360448201527f746976650000000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106de573d6000803e3d6000fd5b600080610a0383610fed565b60005490915060ff1615610a175792915050565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9a91906116ed565b610aa49082611791565b9392505050565b60008054610100900460ff16610b43576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f47617350726963654f7261636c653a206765744c314665655570706572426f7560448201527f6e64206f6e6c7920737570706f72747320466a6f72640000000000000000000060648201526084016102fb565b6000610b5060ff846117d8565b610b5a9084611840565b610b65906010611840565b610b70906044611840565b90506000610b7f846044611840565b9050610b8b828261107d565b949350505050565b6000805460ff1615610c27576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a207363616c61722829206973206465707260448201527f656361746564000000000000000000000000000000000000000000000000000060648201526084016102fb565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b610d7a838383604051602401610cff939291906118b4565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f850b7ad600000000000000000000000000000000000000000000000000000000179052611187565b505050565b600080610d8b836111a8565b51610d97906044611791565b9050600083516044610da99190611791565b9050610deb6040518060400160405280601a81526020017f666173746c7a53697a653a2025732c20747853697a653a20257300000000000081525083836114c5565b610b8b828261107d565b600080610e0183610fed565b90506000610e0d61061c565b610e15610996565b610e209060106118de565b63ffffffff16610e30919061190a565b90506000610e3c610c86565b610e4461067d565b63ffffffff16610e54919061190a565b90506000610e628284611791565b610e6c908561190a565b9050610e7a6006600a611a67565b610e8590601061190a565b610e8f9082611a73565b9695505050505050565b600080610ea583610fed565b9050600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2c91906116ed565b610f3461061c565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb791906116ed565b610fc19085611791565b610fcb919061190a565b610fd5919061190a565b9050610fe36006600a611a67565b610b8b9082611a73565b80516000908190815b818110156110705784818151811061101057611010611a87565b01602001517fff000000000000000000000000000000000000000000000000000000000000001660000361105057611049600484611791565b925061105e565b61105b601084611791565b92505b8061106881611ab6565b915050610ff6565b50610b8b82610440611791565b600080611088610c86565b61109061067d565b63ffffffff166110a0919061190a565b6110a861061c565b6110b0610996565b6110bb9060106118de565b63ffffffff166110cb919061190a565b6110d59190611791565b90506000611103847ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffea5a8611aee565b61111086620fbd26611aee565b61113a907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe5f19de611840565b6111449190611840565b90506000811215611153575060005b61115f6006600261190a565b61116a90600a611a67565b611174838361190a565b61117e9190611a73565b95945050505050565b80516a636f6e736f6c652e6c6f67602083016000808483855afa5050505050565b6060611337565b818153600101919050565b600082840393505b83811015610aa45782810151828201511860001a15909302926001016111c2565b825b6020821061122f5782516111fa601f836111af565b52602092909201917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909101906021016111e5565b8115610aa457825161124460018403836111af565b520160010192915050565b60006001830392505b6101078210611290576112828360ff1661127d60fd61127d8760081c60e001896111af565b6111af565b935061010682039150611258565b600782106112bd576112b68360ff1661127d6007850361127d8760081c60e001896111af565b9050610aa4565b610b8b8360ff1661127d8560081c8560051b01876111af565b61132f82820361131361130384600081518060001a8160011a60081b178160021a60101b17915050919050565b639e3779b90260131c611fff1690565b8060021b6040510182815160e01c1860e01b8151188152505050565b600101919050565b6180003860405139618000604051016020830180600d8551820103826002015b8181101561146a576000805b50508051604051600082901a600183901a60081b1760029290921a60101b91909117639e3779b9810260111c617ffc16909101805160e081811c878603811890911b909118909152840190818303908484106113bf57506113fa565b600184019350611fff82116113f4578251600081901a600182901a60081b1760029190911a60101b1781036113f457506113fa565b50611363565b83831061140857505061146a565b600183039250858311156114265761142387878886036111e3565b96505b61143a6009850160038501600385016111ba565b915061144787828461124f565b96505061145f8461145a868486016112d6565b6112d6565b915050809350611357565b505061147c83838488518501036111e3565b925050506040519150618000820180820391508183526020830160005b838110156114b1578281015182820152602001611499565b506000920191825250602001604052919050565b610d7a8383836040516024016114dd93929190611baa565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f969cdd0300000000000000000000000000000000000000000000000000000000179052611187565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561159957600080fd5b813567ffffffffffffffff808211156115b157600080fd5b818401915084601f8301126115c557600080fd5b8135818111156115d7576115d7611558565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561161d5761161d611558565b8160405282815287602084870101111561163657600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000815180845260005b8181101561167c57602081850181015186830182015201611660565b8181111561168e576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610aa46020830184611656565b6000602082840312156116e657600080fd5b5035919050565b6000602082840312156116ff57600080fd5b5051919050565b60006020828403121561171857600080fd5b815173ffffffffffffffffffffffffffffffffffffffff81168114610aa457600080fd5b60006020828403121561174e57600080fd5b815163ffffffff81168114610aa457600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082198211156117a4576117a4611762565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826117e7576117e76117a9565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f80000000000000000000000000000000000000000000000000000000000000008314161561183b5761183b611762565b500590565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0384138115161561187a5761187a611762565b827f80000000000000000000000000000000000000000000000000000000000000000384128116156118ae576118ae611762565b50500190565b6060815260006118c76060830186611656565b931515602083015250901515604090910152919050565b600063ffffffff8083168185168183048111821515161561190157611901611762565b02949350505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561194257611942611762565b500290565b600181815b808511156119a057817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561198657611986611762565b8085161561199357918102915b93841c939080029061194c565b509250929050565b6000826119b7575060016105f9565b816119c4575060006105f9565b81600181146119da57600281146119e457611a00565b60019150506105f9565b60ff8411156119f5576119f5611762565b50506001821b6105f9565b5060208310610133831016604e8410600b8410161715611a23575081810a6105f9565b611a2d8383611947565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115611a5f57611a5f611762565b029392505050565b6000610aa483836119a8565b600082611a8257611a826117a9565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611ae757611ae7611762565b5060010190565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600084136000841385830485118282161615611b2f57611b2f611762565b7f80000000000000000000000000000000000000000000000000000000000000006000871286820588128184161615611b6a57611b6a611762565b60008712925087820587128484161615611b8657611b86611762565b87850587128184161615611b9c57611b9c611762565b505050929093029392505050565b606081526000611bbd6060830186611656565b6020830194909452506040015291905056fe64616e79616c3a206973466a6f72643a2025732c20697345636f746f6e653a202573a164736f6c634300080f000a", + Bin: "0x608060405234801561001057600080fd5b50611930806100206000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80636ef25c3a116100b2578063de26c4a111610081578063f45e65d811610066578063f45e65d81461025b578063f820614014610263578063fe173b971461020d57600080fd5b8063de26c4a114610235578063f1c7a58b1461024857600080fd5b80636ef25c3a1461020d5780638e98b10614610213578063960e3a231461021b578063c59859181461022d57600080fd5b806349948e0e11610109578063519b4bd3116100ee578063519b4bd31461019f57806354fd4d50146101a757806368d5dca6146101f057600080fd5b806349948e0e1461016f5780634ef6e2241461018257600080fd5b80630c18c1621461013b57806322b90ab3146101565780632e0f262514610160578063313ce56714610168575b600080fd5b61014361026b565b6040519081526020015b60405180910390f35b61015e61038c565b005b610143600681565b6006610143565b61014361017d3660046113a5565b6105af565b60005461018f9060ff1681565b604051901515815260200161014d565b610143610600565b6101e36040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b60405161014d9190611474565b6101f8610661565b60405163ffffffff909116815260200161014d565b48610143565b61015e6106e6565b60005461018f90610100900460ff1681565b6101f861097a565b6101436102433660046113a5565b6109db565b6101436102563660046114e7565b610abf565b610143610b8f565b610143610c82565b6000805460ff1615610304576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f47617350726963654f7261636c653a206f76657268656164282920697320646560448201527f707265636174656400000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611500565b905090565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040f9190611519565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e2073657420697345636f746f6e6520666c6160648201527f6700000000000000000000000000000000000000000000000000000000000000608482015260a4016102fb565b60005460ff1615610582576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a2045636f746f6e6520616c72656164792060448201527f616374697665000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60008054610100900460ff16156105e3576105dd6105cc83610ce3565b516105d890604461157e565b611008565b92915050565b60005460ff16156105f7576105dd826110ee565b6105dd82611192565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611596565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa158015610745573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107699190611519565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610823576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e20736574206973466a6f726420666c61670060648201526084016102fb565b60005460ff166108b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f47617350726963654f7261636c653a20466a6f72642063616e206f6e6c79206260448201527f65206163746976617465642061667465722045636f746f6e650000000000000060648201526084016102fb565b600054610100900460ff161561094c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f47617350726963654f7261636c653a20466a6f726420616c726561647920616360448201527f746976650000000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106c2573d6000803e3d6000fd5b60008054610100900460ff1615610a0c576109f582610ce3565b51610a0190604461157e565b6105dd9060106115bc565b6000610a17836112e6565b60005490915060ff1615610a2b5792915050565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aae9190611500565b610ab8908261157e565b9392505050565b60008054610100900460ff16610b57576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f47617350726963654f7261636c653a206765744c314665655570706572426f7560448201527f6e64206f6e6c7920737570706f72747320466a6f72640000000000000000000060648201526084016102fb565b6000610b6460ff846115f9565b610b6e908461157e565b610b7990601061157e565b610b8490604461157e565b9050610ab881611008565b6000805460ff1615610c23576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a207363616c61722829206973206465707260448201527f656361746564000000000000000000000000000000000000000000000000000060648201526084016102fb565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b6060610e7a565b818153600101919050565b600082840393505b83811015610ab85782810151828201511860001a1590930292600101610cfd565b825b60208210610d6a578251610d35601f83610cea565b52602092909201917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090910190602101610d20565b8115610ab8578251610d7f6001840383610cea565b520160010192915050565b60006001830392505b6101078210610dcb57610dbd8360ff16610db860fd610db88760081c60e00189610cea565b610cea565b935061010682039150610d93565b60078210610df857610df18360ff16610db860078503610db88760081c60e00189610cea565b9050610ab8565b610e118360ff16610db88560081c8560051b0187610cea565b949350505050565b610e72828203610e56610e4684600081518060001a8160011a60081b178160021a60101b17915050919050565b639e3779b90260131c611fff1690565b8060021b6040510182815160e01c1860e01b8151188152505050565b600101919050565b6180003860405139618000604051016020830180600d8551820103826002015b81811015610fad576000805b50508051604051600082901a600183901a60081b1760029290921a60101b91909117639e3779b9810260111c617ffc16909101805160e081811c878603811890911b90911890915284019081830390848410610f025750610f3d565b600184019350611fff8211610f37578251600081901a600182901a60081b1760029190911a60101b178103610f375750610f3d565b50610ea6565b838310610f4b575050610fad565b60018303925085831115610f6957610f668787888603610d1e565b96505b610f7d600985016003850160038501610cf5565b9150610f8a878284610d8a565b965050610fa284610f9d86848601610e19565b610e19565b915050809350610e9a565b5050610fbf8383848851850103610d1e565b925050506040519150618000820180820391508183526020830160005b83811015610ff4578281015182820152602001610fdc565b506000920191825250602001604052919050565b600080611013610c82565b61101b610661565b63ffffffff1661102b91906115bc565b611033610600565b61103b61097a565b611046906010611634565b63ffffffff1661105691906115bc565b611060919061157e565b9050600061107184620cc3946115bc565b61109b907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd763200611660565b90506110ab6047620f42406116d4565b8112156110c3576110c06047620f42406116d4565b90505b6110cf600660026115bc565b6110da90600a6118b0565b6110e483836115bc565b610e1191906115f9565b6000806110fa836112e6565b90506000611106610600565b61110e61097a565b611119906010611634565b63ffffffff1661112991906115bc565b90506000611135610c82565b61113d610661565b63ffffffff1661114d91906115bc565b9050600061115b828461157e565b61116590856115bc565b90506111736006600a6118b0565b61117e9060106115bc565b61118890826115f9565b9695505050505050565b60008061119e836112e6565b9050600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015611201573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112259190611500565b61122d610600565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa15801561128c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b09190611500565b6112ba908561157e565b6112c491906115bc565b6112ce91906115bc565b90506112dc6006600a6118b0565b610e1190826115f9565b80516000908190815b8181101561136957848181518110611309576113096118bc565b01602001517fff00000000000000000000000000000000000000000000000000000000000000166000036113495761134260048461157e565b9250611357565b61135460108461157e565b92505b80611361816118eb565b9150506112ef565b50610e118261044061157e565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156113b757600080fd5b813567ffffffffffffffff808211156113cf57600080fd5b818401915084601f8301126113e357600080fd5b8135818111156113f5576113f5611376565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561143b5761143b611376565b8160405282815287602084870101111561145457600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b818110156114a157858101830151858201604001528201611485565b818111156114b3576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b6000602082840312156114f957600080fd5b5035919050565b60006020828403121561151257600080fd5b5051919050565b60006020828403121561152b57600080fd5b815173ffffffffffffffffffffffffffffffffffffffff81168114610ab857600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082198211156115915761159161154f565b500190565b6000602082840312156115a857600080fd5b815163ffffffff81168114610ab857600080fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156115f4576115f461154f565b500290565b60008261162f577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600063ffffffff808316818516818304811182151516156116575761165761154f565b02949350505050565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0384138115161561169a5761169a61154f565b827f80000000000000000000000000000000000000000000000000000000000000000384128116156116ce576116ce61154f565b50500190565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000841360008413858304851182821616156117155761171561154f565b7f800000000000000000000000000000000000000000000000000000000000000060008712868205881281841616156117505761175061154f565b6000871292508782058712848416161561176c5761176c61154f565b878505871281841616156117825761178261154f565b505050929093029392505050565b600181815b808511156117e957817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156117cf576117cf61154f565b808516156117dc57918102915b93841c9390800290611795565b509250929050565b600082611800575060016105dd565b8161180d575060006105dd565b8160018114611823576002811461182d57611849565b60019150506105dd565b60ff84111561183e5761183e61154f565b50506001821b6105dd565b5060208310610133831016604e8410600b841016171561186c575081810a6105dd565b6118768383611790565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156118a8576118a861154f565b029392505050565b6000610ab883836117f1565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361191c5761191c61154f565b506001019056fea164736f6c634300080f000a", } // GasPriceOracleABI is the input ABI used to generate the binding from. @@ -738,3 +738,4 @@ func (_GasPriceOracle *GasPriceOracleSession) SetFjord() (*types.Transaction, er func (_GasPriceOracle *GasPriceOracleTransactorSession) SetFjord() (*types.Transaction, error) { return _GasPriceOracle.Contract.SetFjord(&_GasPriceOracle.TransactOpts) } + diff --git a/op-e2e/Makefile b/op-e2e/Makefile index d730a7c23f8..6e41da2dd9f 100644 --- a/op-e2e/Makefile +++ b/op-e2e/Makefile @@ -64,3 +64,7 @@ clean: rm -r ../.devnet rm -r ../op-program/bin .PHONY: clean + +fuzz: + go test -ldflags=-extldflags=-Wl,-ld_classic -run NOTAREALTEST -v -fuzztime 10s -fuzz FuzzFastLZ ./ + go test -ldflags=-extldflags=-Wl,-ld_classic -run NOTAREALTEST -v -fuzztime 10s -fuzz FuzzFjordCostFunction ./ diff --git a/op-e2e/external.go b/op-e2e/external.go index a5225e80b60..e5987439394 100644 --- a/op-e2e/external.go +++ b/op-e2e/external.go @@ -65,7 +65,7 @@ func (eec *ExternalEthClient) Close() error { return nil } -func (er *ExternalRunner) Run(t *testing.T) *ExternalEthClient { +func (er *ExternalRunner) Run(t testing.TB) *ExternalEthClient { if er.BinPath == "" { t.Error("no external bin path set") } diff --git a/op-e2e/external/config.go b/op-e2e/external/config.go index b3134c895b3..943abe6346f 100644 --- a/op-e2e/external/config.go +++ b/op-e2e/external/config.go @@ -54,7 +54,7 @@ type TestParms struct { SkipTests map[string]string `json:"skip_tests"` } -func (tp TestParms) SkipIfNecessary(t *testing.T) { +func (tp TestParms) SkipIfNecessary(t testing.TB) { if len(tp.SkipTests) == 0 { return } diff --git a/op-e2e/fastlz_test.go b/op-e2e/fastlz_test.go new file mode 100644 index 00000000000..946b1c43d92 --- /dev/null +++ b/op-e2e/fastlz_test.go @@ -0,0 +1,176 @@ +package op_e2e + +import ( + "context" + "encoding/binary" + "fmt" + "math/big" + "testing" + "time" + + "github.com/ethereum-optimism/optimism/op-bindings/bindings" + "github.com/ethereum-optimism/optimism/op-bindings/predeploys" + "github.com/ethereum-optimism/optimism/op-chain-ops/genesis" + "github.com/ethereum-optimism/optimism/op-e2e/config" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient/simulated" + "github.com/ethereum/go-ethereum/params" + "github.com/stretchr/testify/require" +) + +type testStateGetter struct { + baseFee, blobBaseFee, overhead, scalar *big.Int + baseFeeScalar, blobBaseFeeScalar uint32 +} + +func (sg *testStateGetter) GetState(addr common.Address, slot common.Hash) common.Hash { + buf := common.Hash{} + switch slot { + case types.L1BaseFeeSlot: + sg.baseFee.FillBytes(buf[:]) + case types.OverheadSlot: + sg.overhead.FillBytes(buf[:]) + case types.ScalarSlot: + sg.scalar.FillBytes(buf[:]) + case types.L1BlobBaseFeeSlot: + sg.blobBaseFee.FillBytes(buf[:]) + case types.L1FeeScalarsSlot: + // fetch Ecotone fee sclars + offset := 32 - types.BaseFeeScalarSlotOffset - 4 // todo maybe make scalarSelectSTartPublic + binary.BigEndian.PutUint32(buf[offset:offset+4], sg.baseFeeScalar) + binary.BigEndian.PutUint32(buf[offset+4:offset+8], sg.blobBaseFeeScalar) + default: + panic("unknown slot") + } + return buf +} + +func FuzzFastLZ(f *testing.F) { + l2Allocs := config.L2Allocs(genesis.L2AllocsFjord) + backend := simulated.NewBackend(l2Allocs.Accounts) + defer backend.Close() + + gpoCaller, err := bindings.NewGasPriceOracleCaller(predeploys.GasPriceOracleAddr, backend.Client()) + require.NoError(f, err) + + isFjord, err := gpoCaller.IsFjord(&bind.CallOpts{}) + require.NoError(f, err) + require.True(f, isFjord) + + f.Fuzz(func(t *testing.T, fuzzedData []byte) { + gpoValue, err := gpoCaller.GetL1GasUsed(&bind.CallOpts{}, fuzzedData) + require.NoError(t, err) + + gpoWithoutPadding := gpoValue.Div(gpoValue, big.NewInt(16)) + gpoWithoutPadding.Sub(gpoWithoutPadding, big.NewInt(68)) + + gethValue := types.FlzCompressLen(fuzzedData) + + require.Equal(t, uint64(gethValue), gpoWithoutPadding.Uint64()) + }) +} + +func FuzzFjordCostFunction(f *testing.F) { + cfg := DefaultSystemConfig(f) + s := hexutil.Uint64(0) + cfg.DeployConfig.L2GenesisCanyonTimeOffset = &s + cfg.DeployConfig.L2GenesisDeltaTimeOffset = &s + cfg.DeployConfig.L2GenesisEcotoneTimeOffset = &s + cfg.DeployConfig.L2GenesisFjordTimeOffset = &s + + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + + opGeth, err := NewOpGeth(f, ctx, &cfg) + require.NoError(f, err) + defer opGeth.Close() + + gpoCaller, err := bindings.NewGasPriceOracleCaller(predeploys.GasPriceOracleAddr, opGeth.L2Client) + require.NoError(f, err) + + isFjord, err := gpoCaller.IsFjord(&bind.CallOpts{}) + require.NoError(f, err) + require.True(f, isFjord) + + _, err = opGeth.AddL2Block(context.Background()) + require.NoError(f, err) + + baseFee, err := gpoCaller.L1BaseFee(&bind.CallOpts{}) + require.NoError(f, err) + require.Greater(f, baseFee.Uint64(), uint64(0)) + + blobBaseFee, err := gpoCaller.BlobBaseFee(&bind.CallOpts{}) + require.NoError(f, err) + require.Greater(f, blobBaseFee.Uint64(), uint64(0)) + + baseFeeScalar, err := gpoCaller.BaseFeeScalar(&bind.CallOpts{}) + require.NoError(f, err) + require.Greater(f, baseFeeScalar, uint32(0)) + + blobBaseFeeScalar, err := gpoCaller.BlobBaseFeeScalar(&bind.CallOpts{}) + require.NoError(f, err) + require.Equal(f, blobBaseFeeScalar, uint32(0)) + + // we can ignore the blobbasefee, as the scalar is set to zero. + feeScaled := big.NewInt(16) + feeScaled.Mul(feeScaled, baseFee) + feeScaled.Mul(feeScaled, big.NewInt(int64(baseFeeScalar))) + + db := &testStateGetter{ + baseFee: baseFee, + blobBaseFee: blobBaseFee, + overhead: big.NewInt(0), // not used for fjord + scalar: big.NewInt(0), // not used for fjord + baseFeeScalar: baseFeeScalar, + blobBaseFeeScalar: blobBaseFeeScalar, + } + + zeroTime := uint64(0) + // create a config where ecotone/fjord upgrades are active + config := ¶ms.ChainConfig{ + Optimism: params.OptimismTestConfig.Optimism, + RegolithTime: &zeroTime, + EcotoneTime: &zeroTime, + FjordTime: &zeroTime, + } + require.True(f, config.IsOptimismEcotone(zeroTime)) + require.True(f, config.IsOptimismFjord(zeroTime)) + costFunc := types.NewL1CostFunc(config, db) + + f.Fuzz(func(t *testing.T, fuzzedData []byte) { + flzSize := types.FlzCompressLen(fuzzedData) + + // Skip transactions that will be clamped to the minimum or less. These will fuzz to different values + // due to the solidity l1BlockGenesis adding 68 extra bytes to account for the signature. + estimatedSize := big.NewInt(int64(flzSize)) + estimatedSize.Mul(estimatedSize, types.L1CostFastlzCoef) + estimatedSize.Add(estimatedSize, types.L1CostIntercept) + + if estimatedSize.Cmp(types.MinTransactionSizeScaled) < 0 { + t.Skip() + return + } + + gpoValue, err := gpoCaller.GetL1Fee(&bind.CallOpts{}, fuzzedData) + require.NoError(t, err) + + // remove the adjustment + gpoValue.Mul(gpoValue, big.NewInt(1e12)) + gpoValue.Div(gpoValue, feeScaled) + + totat := new(big.Int).Mul(big.NewInt(68), big.NewInt(836_500)) + gpoValue.Sub(gpoValue, totat) + + gpoValue.Mul(gpoValue, feeScaled) + gpoValue.Div(gpoValue, big.NewInt(1e12)) + + costData := types.NewRollupCostData(fuzzedData) + + gethValue := costFunc(costData, zeroTime) + + require.Equal(t, gethValue.Uint64(), gpoValue.Uint64(), fmt.Sprintf("fuzzedData: %x", common.Bytes2Hex(fuzzedData))) + }) +} diff --git a/op-e2e/op_geth.go b/op-e2e/op_geth.go index 01cfcc0aee7..7cea17d43a4 100644 --- a/op-e2e/op_geth.go +++ b/op-e2e/op_geth.go @@ -51,7 +51,7 @@ type OpGeth struct { lgr log.Logger } -func NewOpGeth(t *testing.T, ctx context.Context, cfg *SystemConfig) (*OpGeth, error) { +func NewOpGeth(t testing.TB, ctx context.Context, cfg *SystemConfig) (*OpGeth, error) { logger := testlog.Logger(t, log.LevelCrit) l1Genesis, err := genesis.BuildL1DeveloperGenesis(cfg.DeployConfig, config.L1Allocs, config.L1Deployments) diff --git a/op-e2e/setup.go b/op-e2e/setup.go index 2e22fd65302..984b27a9edf 100644 --- a/op-e2e/setup.go +++ b/op-e2e/setup.go @@ -84,7 +84,7 @@ func newTxMgrConfig(l1Addr string, privKey *ecdsa.PrivateKey) txmgr.CLIConfig { } } -func DefaultSystemConfig(t *testing.T) SystemConfig { +func DefaultSystemConfig(t testing.TB) SystemConfig { config.ExternalL2TestParms.SkipIfNecessary(t) secrets, err := e2eutils.DefaultMnemonicConfig.Secrets() @@ -161,7 +161,7 @@ func DefaultSystemConfig(t *testing.T) SystemConfig { } } -func writeDefaultJWT(t *testing.T) string { +func writeDefaultJWT(t testing.TB) string { // Sadly the geth node config cannot load JWT secret from memory, it has to be a file jwtPath := path.Join(t.TempDir(), "jwt_secret") if err := os.WriteFile(jwtPath, []byte(hexutil.Encode(testingJWTSecret[:])), 0o600); err != nil { From cfbd6d54b801a0e4bd64b1397f32ed9793a16933 Mon Sep 17 00:00:00 2001 From: Danyal Prout Date: Mon, 29 Apr 2024 19:48:21 -0500 Subject: [PATCH 08/14] increase minimum estimation to 100 / update circleci for e2e fuzz tests --- .circleci/config.yml | 5 +++-- op-e2e/Makefile | 4 ++-- op-e2e/actions/fjord_fork_test.go | 2 +- op-e2e/system_test.go | 2 +- op-node/rollup/derive/fjord_upgrade_transactions.go | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ed2df016ab4..37b9a4f4bce 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1761,8 +1761,9 @@ workflows: - fuzz-golang: name: op-e2e-fuzz package_name: op-e2e - on_changes: op-e2e - requires: [ "go-mod-download" ] + on_changes: op-e2e,packages/contracts-bedrock/src + uses_artifacts: true + requires: ["go-mod-download", "pnpm-monorepo"] - go-test: name: op-heartbeat-tests module: op-heartbeat diff --git a/op-e2e/Makefile b/op-e2e/Makefile index 6e41da2dd9f..5702ae3b977 100644 --- a/op-e2e/Makefile +++ b/op-e2e/Makefile @@ -66,5 +66,5 @@ clean: .PHONY: clean fuzz: - go test -ldflags=-extldflags=-Wl,-ld_classic -run NOTAREALTEST -v -fuzztime 10s -fuzz FuzzFastLZ ./ - go test -ldflags=-extldflags=-Wl,-ld_classic -run NOTAREALTEST -v -fuzztime 10s -fuzz FuzzFjordCostFunction ./ + go test -run NOTAREALTEST -v -fuzztime 10s -fuzz FuzzFastLZ ./ + go test -run NOTAREALTEST -v -fuzztime 10s -fuzz FuzzFjordCostFunction ./ diff --git a/op-e2e/actions/fjord_fork_test.go b/op-e2e/actions/fjord_fork_test.go index 518aa9b61c5..25e335841c4 100644 --- a/op-e2e/actions/fjord_fork_test.go +++ b/op-e2e/actions/fjord_fork_test.go @@ -23,7 +23,7 @@ import ( ) var ( - fjordGasPriceOracleCodeHash = common.HexToHash("0xd932e30ee61cd4af3aa471df75293d2c4c3da7aac54ca3bfd5e0b65f4d7f5fa5") + fjordGasPriceOracleCodeHash = common.HexToHash("0x17563a1e2f4faeee2c47abda44d74d8c91438c26f2f1ba774ef4e3c41cc45f3b") // https://basescan.org/tx/0x8debb2fe54200183fb8baa3c6dbd8e6ec2e4f7a4add87416cd60336b8326d16a txHex = "02f875822105819b8405709fb884057d460082e97f94273ca93a52b817294830ed7572aa591ccfa647fd80881249c58b0021fb3fc080a05bb08ccfd68f83392e446dac64d88a2d28e7072c06502dfabc4a77e77b5c7913a05878d53dd4ebba4f6367e572d524dffcabeec3abb1d8725ee3ac5dc32e1852e3" diff --git a/op-e2e/system_test.go b/op-e2e/system_test.go index 08e52f2d971..18c976e7f39 100644 --- a/op-e2e/system_test.go +++ b/op-e2e/system_test.go @@ -1401,7 +1401,7 @@ func testFees(t *testing.T, cfg SystemConfig) { blobFeeScaled := new(big.Int).Mul(big.NewInt(int64(blobBaseFeeScalar)), blobBaseFee) feeScaled.Add(feeScaled, blobFeeScaled) - result := new(big.Int).Mul(big.NewInt(71*1e6), feeScaled) + result := new(big.Int).Mul(types.MinTransactionSizeScaled, feeScaled) result.Div(result, big.NewInt(1e12)) adjustedGPOFee = result diff --git a/op-node/rollup/derive/fjord_upgrade_transactions.go b/op-node/rollup/derive/fjord_upgrade_transactions.go index ccde9c1b6a1..a2f532c116f 100644 --- a/op-node/rollup/derive/fjord_upgrade_transactions.go +++ b/op-node/rollup/derive/fjord_upgrade_transactions.go @@ -15,7 +15,7 @@ var ( // Gas Price Oracle Parameters deployFjordGasPriceOracleSource = UpgradeDepositSource{Intent: "Fjord: Gas Price Oracle Deployment"} GasPriceOracleFjordDeployerAddress = common.HexToAddress("0x4210000000000000000000000000000000000002") - gasPriceOracleFjordDeploymentBytecode = common.FromHex("0x608060405234801561001057600080fd5b5061187d806100206000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80636ef25c3a116100b2578063de26c4a111610081578063f45e65d811610066578063f45e65d81461025b578063f820614014610263578063fe173b971461020d57600080fd5b8063de26c4a114610235578063f1c7a58b1461024857600080fd5b80636ef25c3a1461020d5780638e98b10614610213578063960e3a231461021b578063c59859181461022d57600080fd5b806349948e0e11610109578063519b4bd3116100ee578063519b4bd31461019f57806354fd4d50146101a757806368d5dca6146101f057600080fd5b806349948e0e1461016f5780634ef6e2241461018257600080fd5b80630c18c1621461013b57806322b90ab3146101565780632e0f262514610160578063313ce56714610168575b600080fd5b61014361026b565b6040519081526020015b60405180910390f35b61015e61038c565b005b610143600681565b6006610143565b61014361017d3660046113ae565b6105af565b60005461018f9060ff1681565b604051901515815260200161014d565b610143610600565b6101e36040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b60405161014d919061147d565b6101f8610661565b60405163ffffffff909116815260200161014d565b48610143565b61015e6106e6565b60005461018f90610100900460ff1681565b6101f861097a565b6101436102433660046113ae565b6109db565b6101436102563660046114f0565b610ac9565b610143610b99565b610143610c8c565b6000805460ff1615610304576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f47617350726963654f7261636c653a206f76657268656164282920697320646560448201527f707265636174656400000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611509565b905090565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040f9190611522565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e2073657420697345636f746f6e6520666c6160648201527f6700000000000000000000000000000000000000000000000000000000000000608482015260a4016102fb565b60005460ff1615610582576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a2045636f746f6e6520616c72656164792060448201527f616374697665000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60008054610100900460ff16156105e3576105dd6105cc83610ced565b516105d8906044611587565b611012565b92915050565b60005460ff16156105f7576105dd826110e0565b6105dd82611184565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106c2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610387919061159f565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa158015610745573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107699190611522565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610823576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e20736574206973466a6f726420666c61670060648201526084016102fb565b60005460ff166108b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f47617350726963654f7261636c653a20466a6f72642063616e206f6e6c79206260448201527f65206163746976617465642061667465722045636f746f6e650000000000000060648201526084016102fb565b600054610100900460ff161561094c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f47617350726963654f7261636c653a20466a6f726420616c726561647920616360448201527f746976650000000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106c2573d6000803e3d6000fd5b60008054610100900460ff1615610a1657610a0b6109f883610ced565b51610a04906044611587565b60476112d8565b6105dd9060106115c5565b6000610a21836112ef565b60005490915060ff1615610a355792915050565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab89190611509565b610ac29082611587565b9392505050565b60008054610100900460ff16610b61576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f47617350726963654f7261636c653a206765744c314665655570706572426f7560448201527f6e64206f6e6c7920737570706f72747320466a6f72640000000000000000000060648201526084016102fb565b6000610b6e60ff84611602565b610b789084611587565b610b83906010611587565b610b8e906044611587565b9050610ac281611012565b6000805460ff1615610c2d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a207363616c61722829206973206465707260448201527f656361746564000000000000000000000000000000000000000000000000000060648201526084016102fb565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b6060610e84565b818153600101919050565b600082840393505b83811015610ac25782810151828201511860001a1590930292600101610d07565b825b60208210610d74578251610d3f601f83610cf4565b52602092909201917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090910190602101610d2a565b8115610ac2578251610d896001840383610cf4565b520160010192915050565b60006001830392505b6101078210610dd557610dc78360ff16610dc260fd610dc28760081c60e00189610cf4565b610cf4565b935061010682039150610d9d565b60078210610e0257610dfb8360ff16610dc260078503610dc28760081c60e00189610cf4565b9050610ac2565b610e1b8360ff16610dc28560081c8560051b0187610cf4565b949350505050565b610e7c828203610e60610e5084600081518060001a8160011a60081b178160021a60101b17915050919050565b639e3779b90260131c611fff1690565b8060021b6040510182815160e01c1860e01b8151188152505050565b600101919050565b6180003860405139618000604051016020830180600d8551820103826002015b81811015610fb7576000805b50508051604051600082901a600183901a60081b1760029290921a60101b91909117639e3779b9810260111c617ffc16909101805160e081811c878603811890911b90911890915284019081830390848410610f0c5750610f47565b600184019350611fff8211610f41578251600081901a600182901a60081b1760029190911a60101b178103610f415750610f47565b50610eb0565b838310610f55575050610fb7565b60018303925085831115610f7357610f708787888603610d28565b96505b610f87600985016003850160038501610cff565b9150610f94878284610d94565b965050610fac84610fa786848601610e23565b610e23565b915050809350610ea4565b5050610fc98383848851850103610d28565b925050506040519150618000820180820391508183526020830160005b83811015610ffe578281015182820152602001610fe6565b506000920191825250602001604052919050565b600061101f8260476112d8565b9150600061102b610c8c565b611033610661565b63ffffffff1661104391906115c5565b61104b610600565b61105361097a565b61105e90601061163d565b63ffffffff1661106e91906115c5565b6110789190611587565b9050600061108984620cc3946115c5565b6110b3907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd763200611669565b90506110c1600660026115c5565b6110cc90600a6117fd565b6110d683836115c5565b610e1b9190611602565b6000806110ec836112ef565b905060006110f8610600565b61110061097a565b61110b90601061163d565b63ffffffff1661111b91906115c5565b90506000611127610c8c565b61112f610661565b63ffffffff1661113f91906115c5565b9050600061114d8284611587565b61115790856115c5565b90506111656006600a6117fd565b6111709060106115c5565b61117a9082611602565b9695505050505050565b600080611190836112ef565b9050600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112179190611509565b61121f610600565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa15801561127e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a29190611509565b6112ac9085611587565b6112b691906115c5565b6112c091906115c5565b90506112ce6006600a6117fd565b610e1b9082611602565b6000818310156112e85781610ac2565b5090919050565b80516000908190815b818110156113725784818151811061131257611312611809565b01602001517fff00000000000000000000000000000000000000000000000000000000000000166000036113525761134b600484611587565b9250611360565b61135d601084611587565b92505b8061136a81611838565b9150506112f8565b50610e1b82610440611587565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156113c057600080fd5b813567ffffffffffffffff808211156113d857600080fd5b818401915084601f8301126113ec57600080fd5b8135818111156113fe576113fe61137f565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156114445761144461137f565b8160405282815287602084870101111561145d57600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b818110156114aa5785810183015185820160400152820161148e565b818111156114bc576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60006020828403121561150257600080fd5b5035919050565b60006020828403121561151b57600080fd5b5051919050565b60006020828403121561153457600080fd5b815173ffffffffffffffffffffffffffffffffffffffff81168114610ac257600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561159a5761159a611558565b500190565b6000602082840312156115b157600080fd5b815163ffffffff81168114610ac257600080fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156115fd576115fd611558565b500290565b600082611638577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600063ffffffff8083168185168183048111821515161561166057611660611558565b02949350505050565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038413811516156116a3576116a3611558565b827f80000000000000000000000000000000000000000000000000000000000000000384128116156116d7576116d7611558565b50500190565b600181815b8085111561173657817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561171c5761171c611558565b8085161561172957918102915b93841c93908002906116e2565b509250929050565b60008261174d575060016105dd565b8161175a575060006105dd565b8160018114611770576002811461177a57611796565b60019150506105dd565b60ff84111561178b5761178b611558565b50506001821b6105dd565b5060208310610133831016604e8410600b84101617156117b9575081810a6105dd565b6117c383836116dd565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156117f5576117f5611558565b029392505050565b6000610ac2838361173e565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361186957611869611558565b506001019056fea164736f6c634300080f000a") + gasPriceOracleFjordDeploymentBytecode = common.FromHex("0x608060405234801561001057600080fd5b50611930806100206000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80636ef25c3a116100b2578063de26c4a111610081578063f45e65d811610066578063f45e65d81461025b578063f820614014610263578063fe173b971461020d57600080fd5b8063de26c4a114610235578063f1c7a58b1461024857600080fd5b80636ef25c3a1461020d5780638e98b10614610213578063960e3a231461021b578063c59859181461022d57600080fd5b806349948e0e11610109578063519b4bd3116100ee578063519b4bd31461019f57806354fd4d50146101a757806368d5dca6146101f057600080fd5b806349948e0e1461016f5780634ef6e2241461018257600080fd5b80630c18c1621461013b57806322b90ab3146101565780632e0f262514610160578063313ce56714610168575b600080fd5b61014361026b565b6040519081526020015b60405180910390f35b61015e61038c565b005b610143600681565b6006610143565b61014361017d3660046113a5565b6105af565b60005461018f9060ff1681565b604051901515815260200161014d565b610143610600565b6101e36040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b60405161014d9190611474565b6101f8610661565b60405163ffffffff909116815260200161014d565b48610143565b61015e6106e6565b60005461018f90610100900460ff1681565b6101f861097a565b6101436102433660046113a5565b6109db565b6101436102563660046114e7565b610abf565b610143610b8f565b610143610c82565b6000805460ff1615610304576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f47617350726963654f7261636c653a206f76657268656164282920697320646560448201527f707265636174656400000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611500565b905090565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040f9190611519565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e2073657420697345636f746f6e6520666c6160648201527f6700000000000000000000000000000000000000000000000000000000000000608482015260a4016102fb565b60005460ff1615610582576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a2045636f746f6e6520616c72656164792060448201527f616374697665000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60008054610100900460ff16156105e3576105dd6105cc83610ce3565b516105d890604461157e565b611008565b92915050565b60005460ff16156105f7576105dd826110ee565b6105dd82611192565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611596565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa158015610745573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107699190611519565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610823576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e20736574206973466a6f726420666c61670060648201526084016102fb565b60005460ff166108b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f47617350726963654f7261636c653a20466a6f72642063616e206f6e6c79206260448201527f65206163746976617465642061667465722045636f746f6e650000000000000060648201526084016102fb565b600054610100900460ff161561094c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f47617350726963654f7261636c653a20466a6f726420616c726561647920616360448201527f746976650000000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106c2573d6000803e3d6000fd5b60008054610100900460ff1615610a0c576109f582610ce3565b51610a0190604461157e565b6105dd9060106115bc565b6000610a17836112e6565b60005490915060ff1615610a2b5792915050565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aae9190611500565b610ab8908261157e565b9392505050565b60008054610100900460ff16610b57576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f47617350726963654f7261636c653a206765744c314665655570706572426f7560448201527f6e64206f6e6c7920737570706f72747320466a6f72640000000000000000000060648201526084016102fb565b6000610b6460ff846115f9565b610b6e908461157e565b610b7990601061157e565b610b8490604461157e565b9050610ab881611008565b6000805460ff1615610c23576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a207363616c61722829206973206465707260448201527f656361746564000000000000000000000000000000000000000000000000000060648201526084016102fb565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b6060610e7a565b818153600101919050565b600082840393505b83811015610ab85782810151828201511860001a1590930292600101610cfd565b825b60208210610d6a578251610d35601f83610cea565b52602092909201917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090910190602101610d20565b8115610ab8578251610d7f6001840383610cea565b520160010192915050565b60006001830392505b6101078210610dcb57610dbd8360ff16610db860fd610db88760081c60e00189610cea565b610cea565b935061010682039150610d93565b60078210610df857610df18360ff16610db860078503610db88760081c60e00189610cea565b9050610ab8565b610e118360ff16610db88560081c8560051b0187610cea565b949350505050565b610e72828203610e56610e4684600081518060001a8160011a60081b178160021a60101b17915050919050565b639e3779b90260131c611fff1690565b8060021b6040510182815160e01c1860e01b8151188152505050565b600101919050565b6180003860405139618000604051016020830180600d8551820103826002015b81811015610fad576000805b50508051604051600082901a600183901a60081b1760029290921a60101b91909117639e3779b9810260111c617ffc16909101805160e081811c878603811890911b90911890915284019081830390848410610f025750610f3d565b600184019350611fff8211610f37578251600081901a600182901a60081b1760029190911a60101b178103610f375750610f3d565b50610ea6565b838310610f4b575050610fad565b60018303925085831115610f6957610f668787888603610d1e565b96505b610f7d600985016003850160038501610cf5565b9150610f8a878284610d8a565b965050610fa284610f9d86848601610e19565b610e19565b915050809350610e9a565b5050610fbf8383848851850103610d1e565b925050506040519150618000820180820391508183526020830160005b83811015610ff4578281015182820152602001610fdc565b506000920191825250602001604052919050565b600080611013610c82565b61101b610661565b63ffffffff1661102b91906115bc565b611033610600565b61103b61097a565b611046906010611634565b63ffffffff1661105691906115bc565b611060919061157e565b9050600061107184620cc3946115bc565b61109b907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd763200611660565b90506110ab6064620f42406116d4565b8112156110c3576110c06064620f42406116d4565b90505b6110cf600660026115bc565b6110da90600a6118b0565b6110e483836115bc565b610e1191906115f9565b6000806110fa836112e6565b90506000611106610600565b61110e61097a565b611119906010611634565b63ffffffff1661112991906115bc565b90506000611135610c82565b61113d610661565b63ffffffff1661114d91906115bc565b9050600061115b828461157e565b61116590856115bc565b90506111736006600a6118b0565b61117e9060106115bc565b61118890826115f9565b9695505050505050565b60008061119e836112e6565b9050600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015611201573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112259190611500565b61122d610600565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa15801561128c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b09190611500565b6112ba908561157e565b6112c491906115bc565b6112ce91906115bc565b90506112dc6006600a6118b0565b610e1190826115f9565b80516000908190815b8181101561136957848181518110611309576113096118bc565b01602001517fff00000000000000000000000000000000000000000000000000000000000000166000036113495761134260048461157e565b9250611357565b61135460108461157e565b92505b80611361816118eb565b9150506112ef565b50610e118261044061157e565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156113b757600080fd5b813567ffffffffffffffff808211156113cf57600080fd5b818401915084601f8301126113e357600080fd5b8135818111156113f5576113f5611376565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561143b5761143b611376565b8160405282815287602084870101111561145457600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b818110156114a157858101830151858201604001528201611485565b818111156114b3576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b6000602082840312156114f957600080fd5b5035919050565b60006020828403121561151257600080fd5b5051919050565b60006020828403121561152b57600080fd5b815173ffffffffffffffffffffffffffffffffffffffff81168114610ab857600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082198211156115915761159161154f565b500190565b6000602082840312156115a857600080fd5b815163ffffffff81168114610ab857600080fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156115f4576115f461154f565b500290565b60008261162f577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600063ffffffff808316818516818304811182151516156116575761165761154f565b02949350505050565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0384138115161561169a5761169a61154f565b827f80000000000000000000000000000000000000000000000000000000000000000384128116156116ce576116ce61154f565b50500190565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000841360008413858304851182821616156117155761171561154f565b7f800000000000000000000000000000000000000000000000000000000000000060008712868205881281841616156117505761175061154f565b6000871292508782058712848416161561176c5761176c61154f565b878505871281841616156117825761178261154f565b505050929093029392505050565b600181815b808511156117e957817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156117cf576117cf61154f565b808516156117dc57918102915b93841c9390800290611795565b509250929050565b600082611800575060016105dd565b8161180d575060006105dd565b8160018114611823576002811461182d57611849565b60019150506105dd565b60ff84111561183e5761183e61154f565b50506001821b6105dd565b5060208310610133831016604e8410600b841016171561186c575081810a6105dd565b6118768383611790565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156118a8576118a861154f565b029392505050565b6000610ab883836117f1565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361191c5761191c61154f565b506001019056fea164736f6c634300080f000a") // Update GasPricePriceOracle Proxy Parameters updateFjordGasPriceOracleSource = UpgradeDepositSource{Intent: "Fjord: Gas Price Oracle Proxy Update"} From 4dc6eeef665852472c7eb396b1292216b9c87215 Mon Sep 17 00:00:00 2001 From: Danyal Prout Date: Tue, 30 Apr 2024 14:07:52 -0500 Subject: [PATCH 09/14] use linear regression for l1 gas used --- go.mod | 3 +- go.sum | 9 ++-- op-e2e/Makefile | 1 - op-e2e/actions/fjord_fork_test.go | 15 +++---- op-e2e/fastlz_test.go | 45 ++++--------------- .../derive/fjord_upgrade_transactions.go | 2 +- 6 files changed, 24 insertions(+), 51 deletions(-) diff --git a/go.mod b/go.mod index 505c9445b6c..c1a5fec46c4 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( github.com/jackc/pgx/v5 v5.5.5 github.com/libp2p/go-libp2p v0.32.0 github.com/libp2p/go-libp2p-mplex v0.9.0 - github.com/libp2p/go-libp2p-pubsub v0.10.1 + github.com/libp2p/go-libp2p-pubsub v0.10.0 github.com/libp2p/go-libp2p-testing v0.12.0 github.com/mattn/go-isatty v0.0.20 github.com/minio/minio-go/v7 v7.0.70 @@ -176,6 +176,7 @@ require ( github.com/multiformats/go-varint v0.0.7 // indirect github.com/naoina/go-stringutil v0.1.0 // indirect github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416 // indirect + github.com/nxadm/tail v1.4.11 // indirect github.com/onsi/ginkgo/v2 v2.15.0 // indirect github.com/opencontainers/runtime-spec v1.1.0 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect diff --git a/go.sum b/go.sum index 41e2a787a42..ada12a4f1ad 100644 --- a/go.sum +++ b/go.sum @@ -198,6 +198,7 @@ github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiD github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= @@ -506,8 +507,8 @@ github.com/libp2p/go-libp2p-asn-util v0.3.0 h1:gMDcMyYiZKkocGXDQ5nsUQyquC9+H+iLE github.com/libp2p/go-libp2p-asn-util v0.3.0/go.mod h1:B1mcOrKUE35Xq/ASTmQ4tN3LNzVVaMNmq2NACuqyB9w= github.com/libp2p/go-libp2p-mplex v0.9.0 h1:R58pDRAmuBXkYugbSSXR9wrTX3+1pFM1xP2bLuodIq8= github.com/libp2p/go-libp2p-mplex v0.9.0/go.mod h1:ro1i4kuwiFT+uMPbIDIFkcLs1KRbNp0QwnUXM+P64Og= -github.com/libp2p/go-libp2p-pubsub v0.10.1 h1:/RqOZpEtAolsr8/9CC8KqROJSOZeu7lK7fPftn4MwNg= -github.com/libp2p/go-libp2p-pubsub v0.10.1/go.mod h1:1OxbaT/pFRO5h+Dpze8hdHQ63R0ke55XTs6b6NwLLkw= +github.com/libp2p/go-libp2p-pubsub v0.10.0 h1:wS0S5FlISavMaAbxyQn3dxMOe2eegMfswM471RuHJwA= +github.com/libp2p/go-libp2p-pubsub v0.10.0/go.mod h1:1OxbaT/pFRO5h+Dpze8hdHQ63R0ke55XTs6b6NwLLkw= github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA= github.com/libp2p/go-libp2p-testing v0.12.0/go.mod h1:KcGDRXyN7sQCllucn1cOOS+Dmm7ujhfEyXQL5lvkcPg= github.com/libp2p/go-mplex v0.7.0 h1:BDhFZdlk5tbr0oyFq/xv/NPGfjbnrsDam1EvutpBDbY= @@ -617,8 +618,9 @@ github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= +github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -982,6 +984,7 @@ golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/op-e2e/Makefile b/op-e2e/Makefile index 5702ae3b977..8e14e316e2f 100644 --- a/op-e2e/Makefile +++ b/op-e2e/Makefile @@ -66,5 +66,4 @@ clean: .PHONY: clean fuzz: - go test -run NOTAREALTEST -v -fuzztime 10s -fuzz FuzzFastLZ ./ go test -run NOTAREALTEST -v -fuzztime 10s -fuzz FuzzFjordCostFunction ./ diff --git a/op-e2e/actions/fjord_fork_test.go b/op-e2e/actions/fjord_fork_test.go index 25e335841c4..5a56cf2cdda 100644 --- a/op-e2e/actions/fjord_fork_test.go +++ b/op-e2e/actions/fjord_fork_test.go @@ -23,12 +23,9 @@ import ( ) var ( - fjordGasPriceOracleCodeHash = common.HexToHash("0x17563a1e2f4faeee2c47abda44d74d8c91438c26f2f1ba774ef4e3c41cc45f3b") + fjordGasPriceOracleCodeHash = common.HexToHash("0x58e192326ee67ed52b7add91e4640024cbd1b21528a0ff1e1d21b7ca54e3ee62") // https://basescan.org/tx/0x8debb2fe54200183fb8baa3c6dbd8e6ec2e4f7a4add87416cd60336b8326d16a txHex = "02f875822105819b8405709fb884057d460082e97f94273ca93a52b817294830ed7572aa591ccfa647fd80881249c58b0021fb3fc080a05bb08ccfd68f83392e446dac64d88a2d28e7072c06502dfabc4a77e77b5c7913a05878d53dd4ebba4f6367e572d524dffcabeec3abb1d8725ee3ac5dc32e1852e3" - - costFastlzCoef int64 = 836_500 - costIntercept int64 = -42_585_600 ) func TestFjordNetworkUpgradeTransactions(gt *testing.T) { @@ -112,9 +109,9 @@ func TestFjordNetworkUpgradeTransactions(gt *testing.T) { l1GasUsed, err := gasPriceOracle.GetL1GasUsed(&bind.CallOpts{}, txData) require.NoError(t, err) + require.Equal(gt, uint64(1_888), l1GasUsed.Uint64()) fastLzSize := types.FlzCompressLen(txData) - require.Equal(gt, l1GasUsed.Uint64(), uint64(fastLzSize+68)*16) // Check that GetL1Fee takes into account fast LZ used, err := gasPriceOracle.GetL1Fee(&bind.CallOpts{}, txData) @@ -137,13 +134,13 @@ func TestFjordNetworkUpgradeTransactions(gt *testing.T) { // l1BaseFeeScaled = l1BaseFeeScalar * l1BaseFee * 16 // l1BlobFeeScaled = l1BlobFeeScalar * l1BlobBaseFee // l1FeeScaled = l1BaseFeeScaled + l1BlobFeeScaled -// ((intercept + fastlzCoef*max(fastlzLength, 71)) * l1FeeScaled) / 1e6 +// ((intercept + fastlzCoef*max(fastlzLength, 100)) * l1FeeScaled) / 1e6 func fjordL1Cost( t require.TestingT, gasPriceOracle *bindings.GasPriceOracleCaller, fastLzLength int64, ) *big.Int { - fastLzLength = max(fastLzLength, 71) + fastLzLength = max(fastLzLength, types.MinTransactionSize.Int64()) baseFeeScalar, err := gasPriceOracle.BaseFeeScalar(nil) require.NoError(t, err) @@ -158,8 +155,8 @@ func fjordL1Cost( feeScaled = new(big.Int).Mul(feeScaled, l1BaseFee) feeScaled = new(big.Int).Add(feeScaled, new(big.Int).Mul(new(big.Int).SetUint64(uint64(blobBaseFeeScalar)), blobBaseFee)) - cost := new(big.Int).Mul(new(big.Int).SetInt64(costFastlzCoef), new(big.Int).SetInt64(fastLzLength+68)) - cost = new(big.Int).Add(cost, new(big.Int).SetInt64(costIntercept)) + cost := new(big.Int).Mul(types.L1CostFastlzCoef, new(big.Int).SetInt64(fastLzLength+68)) + cost = new(big.Int).Add(cost, types.L1CostIntercept) require.True(t, cost.Sign() >= 0) cost = new(big.Int).Mul(cost, feeScaled) diff --git a/op-e2e/fastlz_test.go b/op-e2e/fastlz_test.go index 946b1c43d92..9394abaa874 100644 --- a/op-e2e/fastlz_test.go +++ b/op-e2e/fastlz_test.go @@ -10,13 +10,10 @@ import ( "github.com/ethereum-optimism/optimism/op-bindings/bindings" "github.com/ethereum-optimism/optimism/op-bindings/predeploys" - "github.com/ethereum-optimism/optimism/op-chain-ops/genesis" - "github.com/ethereum-optimism/optimism/op-e2e/config" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethclient/simulated" "github.com/ethereum/go-ethereum/params" "github.com/stretchr/testify/require" ) @@ -48,31 +45,6 @@ func (sg *testStateGetter) GetState(addr common.Address, slot common.Hash) commo return buf } -func FuzzFastLZ(f *testing.F) { - l2Allocs := config.L2Allocs(genesis.L2AllocsFjord) - backend := simulated.NewBackend(l2Allocs.Accounts) - defer backend.Close() - - gpoCaller, err := bindings.NewGasPriceOracleCaller(predeploys.GasPriceOracleAddr, backend.Client()) - require.NoError(f, err) - - isFjord, err := gpoCaller.IsFjord(&bind.CallOpts{}) - require.NoError(f, err) - require.True(f, isFjord) - - f.Fuzz(func(t *testing.T, fuzzedData []byte) { - gpoValue, err := gpoCaller.GetL1GasUsed(&bind.CallOpts{}, fuzzedData) - require.NoError(t, err) - - gpoWithoutPadding := gpoValue.Div(gpoValue, big.NewInt(16)) - gpoWithoutPadding.Sub(gpoWithoutPadding, big.NewInt(68)) - - gethValue := types.FlzCompressLen(fuzzedData) - - require.Equal(t, uint64(gethValue), gpoWithoutPadding.Uint64()) - }) -} - func FuzzFjordCostFunction(f *testing.F) { cfg := DefaultSystemConfig(f) s := hexutil.Uint64(0) @@ -154,23 +126,24 @@ func FuzzFjordCostFunction(f *testing.F) { return } - gpoValue, err := gpoCaller.GetL1Fee(&bind.CallOpts{}, fuzzedData) + l1FeeSolidity, err := gpoCaller.GetL1Fee(&bind.CallOpts{}, fuzzedData) require.NoError(t, err) // remove the adjustment - gpoValue.Mul(gpoValue, big.NewInt(1e12)) - gpoValue.Div(gpoValue, feeScaled) + l1FeeSolidity.Mul(l1FeeSolidity, big.NewInt(1e12)) + l1FeeSolidity.Div(l1FeeSolidity, feeScaled) totat := new(big.Int).Mul(big.NewInt(68), big.NewInt(836_500)) - gpoValue.Sub(gpoValue, totat) + l1FeeSolidity.Sub(l1FeeSolidity, totat) - gpoValue.Mul(gpoValue, feeScaled) - gpoValue.Div(gpoValue, big.NewInt(1e12)) + l1FeeSolidity.Mul(l1FeeSolidity, feeScaled) + l1FeeSolidity.Div(l1FeeSolidity, big.NewInt(1e12)) costData := types.NewRollupCostData(fuzzedData) - gethValue := costFunc(costData, zeroTime) + l1FeeGeth := costFunc(costData, zeroTime) - require.Equal(t, gethValue.Uint64(), gpoValue.Uint64(), fmt.Sprintf("fuzzedData: %x", common.Bytes2Hex(fuzzedData))) + require.Equal(t, l1FeeGeth.Uint64(), l1FeeSolidity.Uint64(), fmt.Sprintf("fuzzedData: %x", common.Bytes2Hex(fuzzedData))) }) + } diff --git a/op-node/rollup/derive/fjord_upgrade_transactions.go b/op-node/rollup/derive/fjord_upgrade_transactions.go index a2f532c116f..31f16282e20 100644 --- a/op-node/rollup/derive/fjord_upgrade_transactions.go +++ b/op-node/rollup/derive/fjord_upgrade_transactions.go @@ -15,7 +15,7 @@ var ( // Gas Price Oracle Parameters deployFjordGasPriceOracleSource = UpgradeDepositSource{Intent: "Fjord: Gas Price Oracle Deployment"} GasPriceOracleFjordDeployerAddress = common.HexToAddress("0x4210000000000000000000000000000000000002") - gasPriceOracleFjordDeploymentBytecode = common.FromHex("0x608060405234801561001057600080fd5b50611930806100206000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80636ef25c3a116100b2578063de26c4a111610081578063f45e65d811610066578063f45e65d81461025b578063f820614014610263578063fe173b971461020d57600080fd5b8063de26c4a114610235578063f1c7a58b1461024857600080fd5b80636ef25c3a1461020d5780638e98b10614610213578063960e3a231461021b578063c59859181461022d57600080fd5b806349948e0e11610109578063519b4bd3116100ee578063519b4bd31461019f57806354fd4d50146101a757806368d5dca6146101f057600080fd5b806349948e0e1461016f5780634ef6e2241461018257600080fd5b80630c18c1621461013b57806322b90ab3146101565780632e0f262514610160578063313ce56714610168575b600080fd5b61014361026b565b6040519081526020015b60405180910390f35b61015e61038c565b005b610143600681565b6006610143565b61014361017d3660046113a5565b6105af565b60005461018f9060ff1681565b604051901515815260200161014d565b610143610600565b6101e36040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b60405161014d9190611474565b6101f8610661565b60405163ffffffff909116815260200161014d565b48610143565b61015e6106e6565b60005461018f90610100900460ff1681565b6101f861097a565b6101436102433660046113a5565b6109db565b6101436102563660046114e7565b610abf565b610143610b8f565b610143610c82565b6000805460ff1615610304576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f47617350726963654f7261636c653a206f76657268656164282920697320646560448201527f707265636174656400000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611500565b905090565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040f9190611519565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e2073657420697345636f746f6e6520666c6160648201527f6700000000000000000000000000000000000000000000000000000000000000608482015260a4016102fb565b60005460ff1615610582576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a2045636f746f6e6520616c72656164792060448201527f616374697665000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60008054610100900460ff16156105e3576105dd6105cc83610ce3565b516105d890604461157e565b611008565b92915050565b60005460ff16156105f7576105dd826110ee565b6105dd82611192565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611596565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa158015610745573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107699190611519565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610823576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e20736574206973466a6f726420666c61670060648201526084016102fb565b60005460ff166108b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f47617350726963654f7261636c653a20466a6f72642063616e206f6e6c79206260448201527f65206163746976617465642061667465722045636f746f6e650000000000000060648201526084016102fb565b600054610100900460ff161561094c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f47617350726963654f7261636c653a20466a6f726420616c726561647920616360448201527f746976650000000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106c2573d6000803e3d6000fd5b60008054610100900460ff1615610a0c576109f582610ce3565b51610a0190604461157e565b6105dd9060106115bc565b6000610a17836112e6565b60005490915060ff1615610a2b5792915050565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aae9190611500565b610ab8908261157e565b9392505050565b60008054610100900460ff16610b57576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f47617350726963654f7261636c653a206765744c314665655570706572426f7560448201527f6e64206f6e6c7920737570706f72747320466a6f72640000000000000000000060648201526084016102fb565b6000610b6460ff846115f9565b610b6e908461157e565b610b7990601061157e565b610b8490604461157e565b9050610ab881611008565b6000805460ff1615610c23576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a207363616c61722829206973206465707260448201527f656361746564000000000000000000000000000000000000000000000000000060648201526084016102fb565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b6060610e7a565b818153600101919050565b600082840393505b83811015610ab85782810151828201511860001a1590930292600101610cfd565b825b60208210610d6a578251610d35601f83610cea565b52602092909201917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090910190602101610d20565b8115610ab8578251610d7f6001840383610cea565b520160010192915050565b60006001830392505b6101078210610dcb57610dbd8360ff16610db860fd610db88760081c60e00189610cea565b610cea565b935061010682039150610d93565b60078210610df857610df18360ff16610db860078503610db88760081c60e00189610cea565b9050610ab8565b610e118360ff16610db88560081c8560051b0187610cea565b949350505050565b610e72828203610e56610e4684600081518060001a8160011a60081b178160021a60101b17915050919050565b639e3779b90260131c611fff1690565b8060021b6040510182815160e01c1860e01b8151188152505050565b600101919050565b6180003860405139618000604051016020830180600d8551820103826002015b81811015610fad576000805b50508051604051600082901a600183901a60081b1760029290921a60101b91909117639e3779b9810260111c617ffc16909101805160e081811c878603811890911b90911890915284019081830390848410610f025750610f3d565b600184019350611fff8211610f37578251600081901a600182901a60081b1760029190911a60101b178103610f375750610f3d565b50610ea6565b838310610f4b575050610fad565b60018303925085831115610f6957610f668787888603610d1e565b96505b610f7d600985016003850160038501610cf5565b9150610f8a878284610d8a565b965050610fa284610f9d86848601610e19565b610e19565b915050809350610e9a565b5050610fbf8383848851850103610d1e565b925050506040519150618000820180820391508183526020830160005b83811015610ff4578281015182820152602001610fdc565b506000920191825250602001604052919050565b600080611013610c82565b61101b610661565b63ffffffff1661102b91906115bc565b611033610600565b61103b61097a565b611046906010611634565b63ffffffff1661105691906115bc565b611060919061157e565b9050600061107184620cc3946115bc565b61109b907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd763200611660565b90506110ab6064620f42406116d4565b8112156110c3576110c06064620f42406116d4565b90505b6110cf600660026115bc565b6110da90600a6118b0565b6110e483836115bc565b610e1191906115f9565b6000806110fa836112e6565b90506000611106610600565b61110e61097a565b611119906010611634565b63ffffffff1661112991906115bc565b90506000611135610c82565b61113d610661565b63ffffffff1661114d91906115bc565b9050600061115b828461157e565b61116590856115bc565b90506111736006600a6118b0565b61117e9060106115bc565b61118890826115f9565b9695505050505050565b60008061119e836112e6565b9050600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015611201573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112259190611500565b61122d610600565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa15801561128c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b09190611500565b6112ba908561157e565b6112c491906115bc565b6112ce91906115bc565b90506112dc6006600a6118b0565b610e1190826115f9565b80516000908190815b8181101561136957848181518110611309576113096118bc565b01602001517fff00000000000000000000000000000000000000000000000000000000000000166000036113495761134260048461157e565b9250611357565b61135460108461157e565b92505b80611361816118eb565b9150506112ef565b50610e118261044061157e565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156113b757600080fd5b813567ffffffffffffffff808211156113cf57600080fd5b818401915084601f8301126113e357600080fd5b8135818111156113f5576113f5611376565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561143b5761143b611376565b8160405282815287602084870101111561145457600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b818110156114a157858101830151858201604001528201611485565b818111156114b3576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b6000602082840312156114f957600080fd5b5035919050565b60006020828403121561151257600080fd5b5051919050565b60006020828403121561152b57600080fd5b815173ffffffffffffffffffffffffffffffffffffffff81168114610ab857600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082198211156115915761159161154f565b500190565b6000602082840312156115a857600080fd5b815163ffffffff81168114610ab857600080fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156115f4576115f461154f565b500290565b60008261162f577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600063ffffffff808316818516818304811182151516156116575761165761154f565b02949350505050565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0384138115161561169a5761169a61154f565b827f80000000000000000000000000000000000000000000000000000000000000000384128116156116ce576116ce61154f565b50500190565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000841360008413858304851182821616156117155761171561154f565b7f800000000000000000000000000000000000000000000000000000000000000060008712868205881281841616156117505761175061154f565b6000871292508782058712848416161561176c5761176c61154f565b878505871281841616156117825761178261154f565b505050929093029392505050565b600181815b808511156117e957817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156117cf576117cf61154f565b808516156117dc57918102915b93841c9390800290611795565b509250929050565b600082611800575060016105dd565b8161180d575060006105dd565b8160018114611823576002811461182d57611849565b60019150506105dd565b60ff84111561183e5761183e61154f565b50506001821b6105dd565b5060208310610133831016604e8410600b841016171561186c575081810a6105dd565b6118768383611790565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156118a8576118a861154f565b029392505050565b6000610ab883836117f1565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361191c5761191c61154f565b506001019056fea164736f6c634300080f000a") + gasPriceOracleFjordDeploymentBytecode = common.FromHex("0x608060405234801561001057600080fd5b50611951806100206000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80636ef25c3a116100b2578063de26c4a111610081578063f45e65d811610066578063f45e65d81461025b578063f820614014610263578063fe173b971461020d57600080fd5b8063de26c4a114610235578063f1c7a58b1461024857600080fd5b80636ef25c3a1461020d5780638e98b10614610213578063960e3a231461021b578063c59859181461022d57600080fd5b806349948e0e11610109578063519b4bd3116100ee578063519b4bd31461019f57806354fd4d50146101a757806368d5dca6146101f057600080fd5b806349948e0e1461016f5780634ef6e2241461018257600080fd5b80630c18c1621461013b57806322b90ab3146101565780632e0f262514610160578063313ce56714610168575b600080fd5b61014361026b565b6040519081526020015b60405180910390f35b61015e61038c565b005b610143600681565b6006610143565b61014361017d3660046113c6565b6105af565b60005461018f9060ff1681565b604051901515815260200161014d565b610143610600565b6101e36040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b60405161014d9190611495565b6101f8610661565b60405163ffffffff909116815260200161014d565b48610143565b61015e6106e6565b60005461018f90610100900460ff1681565b6101f861097a565b6101436102433660046113c6565b6109db565b610143610256366004611508565b610ad5565b610143610ba5565b610143610c98565b6000805460ff1615610304576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f47617350726963654f7261636c653a206f76657268656164282920697320646560448201527f707265636174656400000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611521565b905090565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040f919061153a565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e2073657420697345636f746f6e6520666c6160648201527f6700000000000000000000000000000000000000000000000000000000000000608482015260a4016102fb565b60005460ff1615610582576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a2045636f746f6e6520616c72656164792060448201527f616374697665000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60008054610100900460ff16156105e3576105dd6105cc83610cf9565b516105d890604461159f565b61101e565b92915050565b60005460ff16156105f7576105dd826110b0565b6105dd82611154565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106c2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038791906115b7565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa158015610745573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610769919061153a565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610823576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e20736574206973466a6f726420666c61670060648201526084016102fb565b60005460ff166108b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f47617350726963654f7261636c653a20466a6f72642063616e206f6e6c79206260448201527f65206163746976617465642061667465722045636f746f6e650000000000000060648201526084016102fb565b600054610100900460ff161561094c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f47617350726963654f7261636c653a20466a6f726420616c726561647920616360448201527f746976650000000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106c2573d6000803e3d6000fd5b60008054610100900460ff1615610a2257620f4240610a0d6109fc84610cf9565b51610a0890604461159f565b6112a8565b610a189060106115dd565b6105dd919061161a565b6000610a2d83611307565b60005490915060ff1615610a415792915050565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610aa0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac49190611521565b610ace908261159f565b9392505050565b60008054610100900460ff16610b6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f47617350726963654f7261636c653a206765744c314665655570706572426f7560448201527f6e64206f6e6c7920737570706f72747320466a6f72640000000000000000000060648201526084016102fb565b6000610b7a60ff8461161a565b610b84908461159f565b610b8f90601061159f565b610b9a90604461159f565b9050610ace8161101e565b6000805460ff1615610c39576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a207363616c61722829206973206465707260448201527f656361746564000000000000000000000000000000000000000000000000000060648201526084016102fb565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b6060610e90565b818153600101919050565b600082840393505b83811015610ace5782810151828201511860001a1590930292600101610d13565b825b60208210610d80578251610d4b601f83610d00565b52602092909201917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090910190602101610d36565b8115610ace578251610d956001840383610d00565b520160010192915050565b60006001830392505b6101078210610de157610dd38360ff16610dce60fd610dce8760081c60e00189610d00565b610d00565b935061010682039150610da9565b60078210610e0e57610e078360ff16610dce60078503610dce8760081c60e00189610d00565b9050610ace565b610e278360ff16610dce8560081c8560051b0187610d00565b949350505050565b610e88828203610e6c610e5c84600081518060001a8160011a60081b178160021a60101b17915050919050565b639e3779b90260131c611fff1690565b8060021b6040510182815160e01c1860e01b8151188152505050565b600101919050565b6180003860405139618000604051016020830180600d8551820103826002015b81811015610fc3576000805b50508051604051600082901a600183901a60081b1760029290921a60101b91909117639e3779b9810260111c617ffc16909101805160e081811c878603811890911b90911890915284019081830390848410610f185750610f53565b600184019350611fff8211610f4d578251600081901a600182901a60081b1760029190911a60101b178103610f4d5750610f53565b50610ebc565b838310610f61575050610fc3565b60018303925085831115610f7f57610f7c8787888603610d34565b96505b610f93600985016003850160038501610d0b565b9150610fa0878284610da0565b965050610fb884610fb386848601610e2f565b610e2f565b915050809350610eb0565b5050610fd58383848851850103610d34565b925050506040519150618000820180820391508183526020830160005b8381101561100a578281015182820152602001610ff2565b506000920191825250602001604052919050565b60008061102a836112a8565b90506000611036610c98565b61103e610661565b63ffffffff1661104e91906115dd565b611056610600565b61105e61097a565b611069906010611655565b63ffffffff1661107991906115dd565b611083919061159f565b9050611091600660026115dd565b61109c90600a6117a1565b6110a682846115dd565b610e27919061161a565b6000806110bc83611307565b905060006110c8610600565b6110d061097a565b6110db906010611655565b63ffffffff166110eb91906115dd565b905060006110f7610c98565b6110ff610661565b63ffffffff1661110f91906115dd565b9050600061111d828461159f565b61112790856115dd565b90506111356006600a6117a1565b6111409060106115dd565b61114a908261161a565b9695505050505050565b60008061116083611307565b9050600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e79190611521565b6111ef610600565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa15801561124e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112729190611521565b61127c908561159f565b61128691906115dd565b61129091906115dd565b905061129e6006600a6117a1565b610e27908261161a565b6000806112b883620cc3946115dd565b6112e2907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd7632006117ad565b90506112f26064620f4240611821565b8112156105dd57610ace6064620f4240611821565b80516000908190815b8181101561138a5784818151811061132a5761132a6118dd565b01602001517fff000000000000000000000000000000000000000000000000000000000000001660000361136a5761136360048461159f565b9250611378565b61137560108461159f565b92505b806113828161190c565b915050611310565b50610e278261044061159f565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156113d857600080fd5b813567ffffffffffffffff808211156113f057600080fd5b818401915084601f83011261140457600080fd5b81358181111561141657611416611397565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561145c5761145c611397565b8160405282815287602084870101111561147557600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b818110156114c2578581018301518582016040015282016114a6565b818111156114d4576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60006020828403121561151a57600080fd5b5035919050565b60006020828403121561153357600080fd5b5051919050565b60006020828403121561154c57600080fd5b815173ffffffffffffffffffffffffffffffffffffffff81168114610ace57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082198211156115b2576115b2611570565b500190565b6000602082840312156115c957600080fd5b815163ffffffff81168114610ace57600080fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561161557611615611570565b500290565b600082611650577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600063ffffffff8083168185168183048111821515161561167857611678611570565b02949350505050565b600181815b808511156116da57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156116c0576116c0611570565b808516156116cd57918102915b93841c9390800290611686565b509250929050565b6000826116f1575060016105dd565b816116fe575060006105dd565b8160018114611714576002811461171e5761173a565b60019150506105dd565b60ff84111561172f5761172f611570565b50506001821b6105dd565b5060208310610133831016604e8410600b841016171561175d575081810a6105dd565b6117678383611681565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561179957611799611570565b029392505050565b6000610ace83836116e2565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038413811516156117e7576117e7611570565b827f800000000000000000000000000000000000000000000000000000000000000003841281161561181b5761181b611570565b50500190565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60008413600084138583048511828216161561186257611862611570565b7f8000000000000000000000000000000000000000000000000000000000000000600087128682058812818416161561189d5761189d611570565b600087129250878205871284841616156118b9576118b9611570565b878505871281841616156118cf576118cf611570565b505050929093029392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361193d5761193d611570565b506001019056fea164736f6c634300080f000a") // Update GasPricePriceOracle Proxy Parameters updateFjordGasPriceOracleSource = UpgradeDepositSource{Intent: "Fjord: Gas Price Oracle Proxy Update"} From 4a53cc2d1437f60eede0b5d36fee1369bb4e0e37 Mon Sep 17 00:00:00 2001 From: Danyal Prout Date: Thu, 2 May 2024 11:21:39 +0100 Subject: [PATCH 10/14] Add differential fastlz fuzzing between solady/cgo fastlz/geth fastlz --- op-bindings/bindings/gaspriceoracle.go | 3 +- op-e2e/Makefile | 3 + op-e2e/fastlz/fastlz.c | 508 +++++++++++++++++++++++++ op-e2e/fastlz/fastlz.go | 31 ++ op-e2e/fastlz/fastlz.h | 97 +++++ op-e2e/fastlz_test.go | 61 +++ op-e2e/system_test.go | 4 +- op-service/eth/types.go | 2 +- 8 files changed, 704 insertions(+), 5 deletions(-) create mode 100644 op-e2e/fastlz/fastlz.c create mode 100644 op-e2e/fastlz/fastlz.go create mode 100644 op-e2e/fastlz/fastlz.h diff --git a/op-bindings/bindings/gaspriceoracle.go b/op-bindings/bindings/gaspriceoracle.go index 2a832f68e76..22422d286fb 100644 --- a/op-bindings/bindings/gaspriceoracle.go +++ b/op-bindings/bindings/gaspriceoracle.go @@ -31,7 +31,7 @@ var ( // GasPriceOracleMetaData contains all meta data concerning the GasPriceOracle contract. var GasPriceOracleMetaData = &bind.MetaData{ ABI: "[{\"type\":\"function\",\"name\":\"DECIMALS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"baseFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"baseFeeScalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blobBaseFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blobBaseFeeScalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decimals\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"gasPrice\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getL1Fee\",\"inputs\":[{\"name\":\"_data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getL1FeeUpperBound\",\"inputs\":[{\"name\":\"_unsignedTxSize\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getL1GasUsed\",\"inputs\":[{\"name\":\"_data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isEcotone\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isFjord\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"l1BaseFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"overhead\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"scalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setEcotone\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setFjord\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"}]", - Bin: "0x608060405234801561001057600080fd5b50611930806100206000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80636ef25c3a116100b2578063de26c4a111610081578063f45e65d811610066578063f45e65d81461025b578063f820614014610263578063fe173b971461020d57600080fd5b8063de26c4a114610235578063f1c7a58b1461024857600080fd5b80636ef25c3a1461020d5780638e98b10614610213578063960e3a231461021b578063c59859181461022d57600080fd5b806349948e0e11610109578063519b4bd3116100ee578063519b4bd31461019f57806354fd4d50146101a757806368d5dca6146101f057600080fd5b806349948e0e1461016f5780634ef6e2241461018257600080fd5b80630c18c1621461013b57806322b90ab3146101565780632e0f262514610160578063313ce56714610168575b600080fd5b61014361026b565b6040519081526020015b60405180910390f35b61015e61038c565b005b610143600681565b6006610143565b61014361017d3660046113a5565b6105af565b60005461018f9060ff1681565b604051901515815260200161014d565b610143610600565b6101e36040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b60405161014d9190611474565b6101f8610661565b60405163ffffffff909116815260200161014d565b48610143565b61015e6106e6565b60005461018f90610100900460ff1681565b6101f861097a565b6101436102433660046113a5565b6109db565b6101436102563660046114e7565b610abf565b610143610b8f565b610143610c82565b6000805460ff1615610304576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f47617350726963654f7261636c653a206f76657268656164282920697320646560448201527f707265636174656400000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611500565b905090565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040f9190611519565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e2073657420697345636f746f6e6520666c6160648201527f6700000000000000000000000000000000000000000000000000000000000000608482015260a4016102fb565b60005460ff1615610582576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a2045636f746f6e6520616c72656164792060448201527f616374697665000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60008054610100900460ff16156105e3576105dd6105cc83610ce3565b516105d890604461157e565b611008565b92915050565b60005460ff16156105f7576105dd826110ee565b6105dd82611192565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611596565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa158015610745573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107699190611519565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610823576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e20736574206973466a6f726420666c61670060648201526084016102fb565b60005460ff166108b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f47617350726963654f7261636c653a20466a6f72642063616e206f6e6c79206260448201527f65206163746976617465642061667465722045636f746f6e650000000000000060648201526084016102fb565b600054610100900460ff161561094c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f47617350726963654f7261636c653a20466a6f726420616c726561647920616360448201527f746976650000000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106c2573d6000803e3d6000fd5b60008054610100900460ff1615610a0c576109f582610ce3565b51610a0190604461157e565b6105dd9060106115bc565b6000610a17836112e6565b60005490915060ff1615610a2b5792915050565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aae9190611500565b610ab8908261157e565b9392505050565b60008054610100900460ff16610b57576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f47617350726963654f7261636c653a206765744c314665655570706572426f7560448201527f6e64206f6e6c7920737570706f72747320466a6f72640000000000000000000060648201526084016102fb565b6000610b6460ff846115f9565b610b6e908461157e565b610b7990601061157e565b610b8490604461157e565b9050610ab881611008565b6000805460ff1615610c23576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a207363616c61722829206973206465707260448201527f656361746564000000000000000000000000000000000000000000000000000060648201526084016102fb565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b6060610e7a565b818153600101919050565b600082840393505b83811015610ab85782810151828201511860001a1590930292600101610cfd565b825b60208210610d6a578251610d35601f83610cea565b52602092909201917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090910190602101610d20565b8115610ab8578251610d7f6001840383610cea565b520160010192915050565b60006001830392505b6101078210610dcb57610dbd8360ff16610db860fd610db88760081c60e00189610cea565b610cea565b935061010682039150610d93565b60078210610df857610df18360ff16610db860078503610db88760081c60e00189610cea565b9050610ab8565b610e118360ff16610db88560081c8560051b0187610cea565b949350505050565b610e72828203610e56610e4684600081518060001a8160011a60081b178160021a60101b17915050919050565b639e3779b90260131c611fff1690565b8060021b6040510182815160e01c1860e01b8151188152505050565b600101919050565b6180003860405139618000604051016020830180600d8551820103826002015b81811015610fad576000805b50508051604051600082901a600183901a60081b1760029290921a60101b91909117639e3779b9810260111c617ffc16909101805160e081811c878603811890911b90911890915284019081830390848410610f025750610f3d565b600184019350611fff8211610f37578251600081901a600182901a60081b1760029190911a60101b178103610f375750610f3d565b50610ea6565b838310610f4b575050610fad565b60018303925085831115610f6957610f668787888603610d1e565b96505b610f7d600985016003850160038501610cf5565b9150610f8a878284610d8a565b965050610fa284610f9d86848601610e19565b610e19565b915050809350610e9a565b5050610fbf8383848851850103610d1e565b925050506040519150618000820180820391508183526020830160005b83811015610ff4578281015182820152602001610fdc565b506000920191825250602001604052919050565b600080611013610c82565b61101b610661565b63ffffffff1661102b91906115bc565b611033610600565b61103b61097a565b611046906010611634565b63ffffffff1661105691906115bc565b611060919061157e565b9050600061107184620cc3946115bc565b61109b907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd763200611660565b90506110ab6047620f42406116d4565b8112156110c3576110c06047620f42406116d4565b90505b6110cf600660026115bc565b6110da90600a6118b0565b6110e483836115bc565b610e1191906115f9565b6000806110fa836112e6565b90506000611106610600565b61110e61097a565b611119906010611634565b63ffffffff1661112991906115bc565b90506000611135610c82565b61113d610661565b63ffffffff1661114d91906115bc565b9050600061115b828461157e565b61116590856115bc565b90506111736006600a6118b0565b61117e9060106115bc565b61118890826115f9565b9695505050505050565b60008061119e836112e6565b9050600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015611201573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112259190611500565b61122d610600565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa15801561128c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b09190611500565b6112ba908561157e565b6112c491906115bc565b6112ce91906115bc565b90506112dc6006600a6118b0565b610e1190826115f9565b80516000908190815b8181101561136957848181518110611309576113096118bc565b01602001517fff00000000000000000000000000000000000000000000000000000000000000166000036113495761134260048461157e565b9250611357565b61135460108461157e565b92505b80611361816118eb565b9150506112ef565b50610e118261044061157e565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156113b757600080fd5b813567ffffffffffffffff808211156113cf57600080fd5b818401915084601f8301126113e357600080fd5b8135818111156113f5576113f5611376565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561143b5761143b611376565b8160405282815287602084870101111561145457600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b818110156114a157858101830151858201604001528201611485565b818111156114b3576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b6000602082840312156114f957600080fd5b5035919050565b60006020828403121561151257600080fd5b5051919050565b60006020828403121561152b57600080fd5b815173ffffffffffffffffffffffffffffffffffffffff81168114610ab857600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082198211156115915761159161154f565b500190565b6000602082840312156115a857600080fd5b815163ffffffff81168114610ab857600080fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156115f4576115f461154f565b500290565b60008261162f577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600063ffffffff808316818516818304811182151516156116575761165761154f565b02949350505050565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0384138115161561169a5761169a61154f565b827f80000000000000000000000000000000000000000000000000000000000000000384128116156116ce576116ce61154f565b50500190565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000841360008413858304851182821616156117155761171561154f565b7f800000000000000000000000000000000000000000000000000000000000000060008712868205881281841616156117505761175061154f565b6000871292508782058712848416161561176c5761176c61154f565b878505871281841616156117825761178261154f565b505050929093029392505050565b600181815b808511156117e957817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156117cf576117cf61154f565b808516156117dc57918102915b93841c9390800290611795565b509250929050565b600082611800575060016105dd565b8161180d575060006105dd565b8160018114611823576002811461182d57611849565b60019150506105dd565b60ff84111561183e5761183e61154f565b50506001821b6105dd565b5060208310610133831016604e8410600b841016171561186c575081810a6105dd565b6118768383611790565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156118a8576118a861154f565b029392505050565b6000610ab883836117f1565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361191c5761191c61154f565b506001019056fea164736f6c634300080f000a", + Bin: "0x608060405234801561001057600080fd5b50611951806100206000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80636ef25c3a116100b2578063de26c4a111610081578063f45e65d811610066578063f45e65d81461025b578063f820614014610263578063fe173b971461020d57600080fd5b8063de26c4a114610235578063f1c7a58b1461024857600080fd5b80636ef25c3a1461020d5780638e98b10614610213578063960e3a231461021b578063c59859181461022d57600080fd5b806349948e0e11610109578063519b4bd3116100ee578063519b4bd31461019f57806354fd4d50146101a757806368d5dca6146101f057600080fd5b806349948e0e1461016f5780634ef6e2241461018257600080fd5b80630c18c1621461013b57806322b90ab3146101565780632e0f262514610160578063313ce56714610168575b600080fd5b61014361026b565b6040519081526020015b60405180910390f35b61015e61038c565b005b610143600681565b6006610143565b61014361017d3660046113c6565b6105af565b60005461018f9060ff1681565b604051901515815260200161014d565b610143610600565b6101e36040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b60405161014d9190611495565b6101f8610661565b60405163ffffffff909116815260200161014d565b48610143565b61015e6106e6565b60005461018f90610100900460ff1681565b6101f861097a565b6101436102433660046113c6565b6109db565b610143610256366004611508565b610ad5565b610143610ba5565b610143610c98565b6000805460ff1615610304576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f47617350726963654f7261636c653a206f76657268656164282920697320646560448201527f707265636174656400000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611521565b905090565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040f919061153a565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e2073657420697345636f746f6e6520666c6160648201527f6700000000000000000000000000000000000000000000000000000000000000608482015260a4016102fb565b60005460ff1615610582576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a2045636f746f6e6520616c72656164792060448201527f616374697665000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60008054610100900460ff16156105e3576105dd6105cc83610cf9565b516105d890604461159f565b61101e565b92915050565b60005460ff16156105f7576105dd826110b0565b6105dd82611154565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106c2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038791906115b7565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa158015610745573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610769919061153a565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610823576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e20736574206973466a6f726420666c61670060648201526084016102fb565b60005460ff166108b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f47617350726963654f7261636c653a20466a6f72642063616e206f6e6c79206260448201527f65206163746976617465642061667465722045636f746f6e650000000000000060648201526084016102fb565b600054610100900460ff161561094c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f47617350726963654f7261636c653a20466a6f726420616c726561647920616360448201527f746976650000000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106c2573d6000803e3d6000fd5b60008054610100900460ff1615610a2257620f4240610a0d6109fc84610cf9565b51610a0890604461159f565b6112a8565b610a189060106115dd565b6105dd919061161a565b6000610a2d83611307565b60005490915060ff1615610a415792915050565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610aa0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac49190611521565b610ace908261159f565b9392505050565b60008054610100900460ff16610b6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f47617350726963654f7261636c653a206765744c314665655570706572426f7560448201527f6e64206f6e6c7920737570706f72747320466a6f72640000000000000000000060648201526084016102fb565b6000610b7a60ff8461161a565b610b84908461159f565b610b8f90601061159f565b610b9a90604461159f565b9050610ace8161101e565b6000805460ff1615610c39576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a207363616c61722829206973206465707260448201527f656361746564000000000000000000000000000000000000000000000000000060648201526084016102fb565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b6060610e90565b818153600101919050565b600082840393505b83811015610ace5782810151828201511860001a1590930292600101610d13565b825b60208210610d80578251610d4b601f83610d00565b52602092909201917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090910190602101610d36565b8115610ace578251610d956001840383610d00565b520160010192915050565b60006001830392505b6101078210610de157610dd38360ff16610dce60fd610dce8760081c60e00189610d00565b610d00565b935061010682039150610da9565b60078210610e0e57610e078360ff16610dce60078503610dce8760081c60e00189610d00565b9050610ace565b610e278360ff16610dce8560081c8560051b0187610d00565b949350505050565b610e88828203610e6c610e5c84600081518060001a8160011a60081b178160021a60101b17915050919050565b639e3779b90260131c611fff1690565b8060021b6040510182815160e01c1860e01b8151188152505050565b600101919050565b6180003860405139618000604051016020830180600d8551820103826002015b81811015610fc3576000805b50508051604051600082901a600183901a60081b1760029290921a60101b91909117639e3779b9810260111c617ffc16909101805160e081811c878603811890911b90911890915284019081830390848410610f185750610f53565b600184019350611fff8211610f4d578251600081901a600182901a60081b1760029190911a60101b178103610f4d5750610f53565b50610ebc565b838310610f61575050610fc3565b60018303925085831115610f7f57610f7c8787888603610d34565b96505b610f93600985016003850160038501610d0b565b9150610fa0878284610da0565b965050610fb884610fb386848601610e2f565b610e2f565b915050809350610eb0565b5050610fd58383848851850103610d34565b925050506040519150618000820180820391508183526020830160005b8381101561100a578281015182820152602001610ff2565b506000920191825250602001604052919050565b60008061102a836112a8565b90506000611036610c98565b61103e610661565b63ffffffff1661104e91906115dd565b611056610600565b61105e61097a565b611069906010611655565b63ffffffff1661107991906115dd565b611083919061159f565b9050611091600660026115dd565b61109c90600a6117a1565b6110a682846115dd565b610e27919061161a565b6000806110bc83611307565b905060006110c8610600565b6110d061097a565b6110db906010611655565b63ffffffff166110eb91906115dd565b905060006110f7610c98565b6110ff610661565b63ffffffff1661110f91906115dd565b9050600061111d828461159f565b61112790856115dd565b90506111356006600a6117a1565b6111409060106115dd565b61114a908261161a565b9695505050505050565b60008061116083611307565b9050600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e79190611521565b6111ef610600565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa15801561124e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112729190611521565b61127c908561159f565b61128691906115dd565b61129091906115dd565b905061129e6006600a6117a1565b610e27908261161a565b6000806112b883620cc3946115dd565b6112e2907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd7632006117ad565b90506112f26064620f4240611821565b8112156105dd57610ace6064620f4240611821565b80516000908190815b8181101561138a5784818151811061132a5761132a6118dd565b01602001517fff000000000000000000000000000000000000000000000000000000000000001660000361136a5761136360048461159f565b9250611378565b61137560108461159f565b92505b806113828161190c565b915050611310565b50610e278261044061159f565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156113d857600080fd5b813567ffffffffffffffff808211156113f057600080fd5b818401915084601f83011261140457600080fd5b81358181111561141657611416611397565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561145c5761145c611397565b8160405282815287602084870101111561147557600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b818110156114c2578581018301518582016040015282016114a6565b818111156114d4576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60006020828403121561151a57600080fd5b5035919050565b60006020828403121561153357600080fd5b5051919050565b60006020828403121561154c57600080fd5b815173ffffffffffffffffffffffffffffffffffffffff81168114610ace57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082198211156115b2576115b2611570565b500190565b6000602082840312156115c957600080fd5b815163ffffffff81168114610ace57600080fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561161557611615611570565b500290565b600082611650577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600063ffffffff8083168185168183048111821515161561167857611678611570565b02949350505050565b600181815b808511156116da57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156116c0576116c0611570565b808516156116cd57918102915b93841c9390800290611686565b509250929050565b6000826116f1575060016105dd565b816116fe575060006105dd565b8160018114611714576002811461171e5761173a565b60019150506105dd565b60ff84111561172f5761172f611570565b50506001821b6105dd565b5060208310610133831016604e8410600b841016171561175d575081810a6105dd565b6117678383611681565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561179957611799611570565b029392505050565b6000610ace83836116e2565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038413811516156117e7576117e7611570565b827f800000000000000000000000000000000000000000000000000000000000000003841281161561181b5761181b611570565b50500190565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60008413600084138583048511828216161561186257611862611570565b7f8000000000000000000000000000000000000000000000000000000000000000600087128682058812818416161561189d5761189d611570565b600087129250878205871284841616156118b9576118b9611570565b878505871281841616156118cf576118cf611570565b505050929093029392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361193d5761193d611570565b506001019056fea164736f6c634300080f000a", } // GasPriceOracleABI is the input ABI used to generate the binding from. @@ -738,4 +738,3 @@ func (_GasPriceOracle *GasPriceOracleSession) SetFjord() (*types.Transaction, er func (_GasPriceOracle *GasPriceOracleTransactorSession) SetFjord() (*types.Transaction, error) { return _GasPriceOracle.Contract.SetFjord(&_GasPriceOracle.TransactOpts) } - diff --git a/op-e2e/Makefile b/op-e2e/Makefile index 8e14e316e2f..707227f14da 100644 --- a/op-e2e/Makefile +++ b/op-e2e/Makefile @@ -67,3 +67,6 @@ clean: fuzz: go test -run NOTAREALTEST -v -fuzztime 10s -fuzz FuzzFjordCostFunction ./ + go test -run NOTAREALTEST -v -fuzztime 10s -fuzz FuzzFastLzGethSolidity ./ + go test -run NOTAREALTEST -v -fuzztime 10s -fuzz FuzzFastLzCgo ./ + diff --git a/op-e2e/fastlz/fastlz.c b/op-e2e/fastlz/fastlz.c new file mode 100644 index 00000000000..3e3a1549caf --- /dev/null +++ b/op-e2e/fastlz/fastlz.c @@ -0,0 +1,508 @@ +/* + FastLZ - Byte-aligned LZ77 compression library + Copyright (C) 2005-2020 Ariya Hidayat + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ + +#include "fastlz.h" + +#include + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" + +/* + * Give hints to the compiler for branch prediction optimization. + */ +#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 2)) +#define FASTLZ_LIKELY(c) (__builtin_expect(!!(c), 1)) +#define FASTLZ_UNLIKELY(c) (__builtin_expect(!!(c), 0)) +#else +#define FASTLZ_LIKELY(c) (c) +#define FASTLZ_UNLIKELY(c) (c) +#endif + +/* + * Specialize custom 64-bit implementation for speed improvements. + */ +#if defined(__x86_64__) || defined(_M_X64) || defined(__aarch64__) +#define FLZ_ARCH64 +#endif + +/* + * Workaround for DJGPP to find uint8_t, uint16_t, etc. + */ +#if defined(__MSDOS__) && defined(__GNUC__) +#include +#endif + +#if defined(FASTLZ_USE_MEMMOVE) && (FASTLZ_USE_MEMMOVE == 0) + +static void fastlz_memmove(uint8_t* dest, const uint8_t* src, uint32_t count) { + do { + *dest++ = *src++; + } while (--count); +} + +static void fastlz_memcpy(uint8_t* dest, const uint8_t* src, uint32_t count) { + return fastlz_memmove(dest, src, count); +} + +#else + +#include + +static void fastlz_memmove(uint8_t* dest, const uint8_t* src, uint32_t count) { + if ((count > 4) && (dest >= src + count)) { + memmove(dest, src, count); + } else { + switch (count) { + default: + do { + *dest++ = *src++; + } while (--count); + break; + case 3: + *dest++ = *src++; + case 2: + *dest++ = *src++; + case 1: + *dest++ = *src++; + case 0: + break; + } + } +} + +static void fastlz_memcpy(uint8_t* dest, const uint8_t* src, uint32_t count) { memcpy(dest, src, count); } + +#endif + +#if defined(FLZ_ARCH64) + +static uint32_t flz_readu32(const void* ptr) { return *(const uint32_t*)ptr; } + +static uint32_t flz_cmp(const uint8_t* p, const uint8_t* q, const uint8_t* r) { + const uint8_t* start = p; + + if (flz_readu32(p) == flz_readu32(q)) { + p += 4; + q += 4; + } + while (q < r) + if (*p++ != *q++) break; + return p - start; +} + +#endif /* FLZ_ARCH64 */ + +#if !defined(FLZ_ARCH64) + +static uint32_t flz_readu32(const void* ptr) { + const uint8_t* p = (const uint8_t*)ptr; + return (p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0]; +} + +static uint32_t flz_cmp(const uint8_t* p, const uint8_t* q, const uint8_t* r) { + const uint8_t* start = p; + while (q < r) + if (*p++ != *q++) break; + return p - start; +} + +#endif /* !FLZ_ARCH64 */ + +#define MAX_COPY 32 +#define MAX_LEN 264 /* 256 + 8 */ +#define MAX_L1_DISTANCE 8192 +#define MAX_L2_DISTANCE 8191 +#define MAX_FARDISTANCE (65535 + MAX_L2_DISTANCE - 1) + +#define HASH_LOG 13 +#define HASH_SIZE (1 << HASH_LOG) +#define HASH_MASK (HASH_SIZE - 1) + +static uint16_t flz_hash(uint32_t v) { + uint32_t h = (v * 2654435769LL) >> (32 - HASH_LOG); + return h & HASH_MASK; +} + +/* special case of memcpy: at most MAX_COPY bytes */ +static void flz_smallcopy(uint8_t* dest, const uint8_t* src, uint32_t count) { +#if defined(FLZ_ARCH64) + if (count >= 4) { + const uint32_t* p = (const uint32_t*)src; + uint32_t* q = (uint32_t*)dest; + while (count > 4) { + *q++ = *p++; + count -= 4; + dest += 4; + src += 4; + } + } +#endif + fastlz_memcpy(dest, src, count); +} + +/* special case of memcpy: exactly MAX_COPY bytes */ +static void flz_maxcopy(void* dest, const void* src) { +#if defined(FLZ_ARCH64) + const uint32_t* p = (const uint32_t*)src; + uint32_t* q = (uint32_t*)dest; + *q++ = *p++; + *q++ = *p++; + *q++ = *p++; + *q++ = *p++; + *q++ = *p++; + *q++ = *p++; + *q++ = *p++; + *q++ = *p++; +#else + fastlz_memcpy(dest, src, MAX_COPY); +#endif +} + +static uint8_t* flz_literals(uint32_t runs, const uint8_t* src, uint8_t* dest) { + while (runs >= MAX_COPY) { + *dest++ = MAX_COPY - 1; + flz_maxcopy(dest, src); + src += MAX_COPY; + dest += MAX_COPY; + runs -= MAX_COPY; + } + if (runs > 0) { + *dest++ = runs - 1; + flz_smallcopy(dest, src, runs); + dest += runs; + } + return dest; +} + +static uint8_t* flz1_match(uint32_t len, uint32_t distance, uint8_t* op) { + --distance; + if (FASTLZ_UNLIKELY(len > MAX_LEN - 2)) + while (len > MAX_LEN - 2) { + *op++ = (7 << 5) + (distance >> 8); + *op++ = MAX_LEN - 2 - 7 - 2; + *op++ = (distance & 255); + len -= MAX_LEN - 2; + } + if (len < 7) { + *op++ = (len << 5) + (distance >> 8); + *op++ = (distance & 255); + } else { + *op++ = (7 << 5) + (distance >> 8); + *op++ = len - 7; + *op++ = (distance & 255); + } + return op; +} + +#define FASTLZ_BOUND_CHECK(cond) \ + if (FASTLZ_UNLIKELY(!(cond))) return 0; + +int fastlz1_compress(const void* input, int length, void* output) { + const uint8_t* ip = (const uint8_t*)input; + const uint8_t* ip_start = ip; + const uint8_t* ip_bound = ip + length - 4; /* because readU32 */ + const uint8_t* ip_limit = ip + length - 12 - 1; + uint8_t* op = (uint8_t*)output; + + uint32_t htab[HASH_SIZE]; + uint32_t seq, hash; + + /* initializes hash table */ + for (hash = 0; hash < HASH_SIZE; ++hash) htab[hash] = 0; + + /* we start with literal copy */ + const uint8_t* anchor = ip; + ip += 2; + + /* main loop */ + while (FASTLZ_LIKELY(ip < ip_limit)) { + const uint8_t* ref; + uint32_t distance, cmp; + + /* find potential match */ + do { + seq = flz_readu32(ip) & 0xffffff; + hash = flz_hash(seq); + ref = ip_start + htab[hash]; + htab[hash] = ip - ip_start; + distance = ip - ref; + cmp = FASTLZ_LIKELY(distance < MAX_L1_DISTANCE) ? flz_readu32(ref) & 0xffffff : 0x1000000; + if (FASTLZ_UNLIKELY(ip >= ip_limit)) break; + ++ip; + } while (seq != cmp); + + if (FASTLZ_UNLIKELY(ip >= ip_limit)) break; + --ip; + + if (FASTLZ_LIKELY(ip > anchor)) { + op = flz_literals(ip - anchor, anchor, op); + } + + uint32_t len = flz_cmp(ref + 3, ip + 3, ip_bound); + op = flz1_match(len, distance, op); + + /* update the hash at match boundary */ + ip += len; + seq = flz_readu32(ip); + hash = flz_hash(seq & 0xffffff); + htab[hash] = ip++ - ip_start; + seq >>= 8; + hash = flz_hash(seq); + htab[hash] = ip++ - ip_start; + + anchor = ip; + } + + uint32_t copy = (uint8_t*)input + length - anchor; + op = flz_literals(copy, anchor, op); + + return op - (uint8_t*)output; +} + +int fastlz1_decompress(const void* input, int length, void* output, int maxout) { + const uint8_t* ip = (const uint8_t*)input; + const uint8_t* ip_limit = ip + length; + const uint8_t* ip_bound = ip_limit - 2; + uint8_t* op = (uint8_t*)output; + uint8_t* op_limit = op + maxout; + uint32_t ctrl = (*ip++) & 31; + + while (1) { + if (ctrl >= 32) { + uint32_t len = (ctrl >> 5) - 1; + uint32_t ofs = (ctrl & 31) << 8; + const uint8_t* ref = op - ofs - 1; + if (len == 7 - 1) { + FASTLZ_BOUND_CHECK(ip <= ip_bound); + len += *ip++; + } + ref -= *ip++; + len += 3; + FASTLZ_BOUND_CHECK(op + len <= op_limit); + FASTLZ_BOUND_CHECK(ref >= (uint8_t*)output); + fastlz_memmove(op, ref, len); + op += len; + } else { + ctrl++; + FASTLZ_BOUND_CHECK(op + ctrl <= op_limit); + FASTLZ_BOUND_CHECK(ip + ctrl <= ip_limit); + fastlz_memcpy(op, ip, ctrl); + ip += ctrl; + op += ctrl; + } + + if (FASTLZ_UNLIKELY(ip > ip_bound)) break; + ctrl = *ip++; + } + + return op - (uint8_t*)output; +} + +static uint8_t* flz2_match(uint32_t len, uint32_t distance, uint8_t* op) { + --distance; + if (distance < MAX_L2_DISTANCE) { + if (len < 7) { + *op++ = (len << 5) + (distance >> 8); + *op++ = (distance & 255); + } else { + *op++ = (7 << 5) + (distance >> 8); + for (len -= 7; len >= 255; len -= 255) *op++ = 255; + *op++ = len; + *op++ = (distance & 255); + } + } else { + /* far away, but not yet in the another galaxy... */ + if (len < 7) { + distance -= MAX_L2_DISTANCE; + *op++ = (len << 5) + 31; + *op++ = 255; + *op++ = distance >> 8; + *op++ = distance & 255; + } else { + distance -= MAX_L2_DISTANCE; + *op++ = (7 << 5) + 31; + for (len -= 7; len >= 255; len -= 255) *op++ = 255; + *op++ = len; + *op++ = 255; + *op++ = distance >> 8; + *op++ = distance & 255; + } + } + return op; +} + +int fastlz2_compress(const void* input, int length, void* output) { + const uint8_t* ip = (const uint8_t*)input; + const uint8_t* ip_start = ip; + const uint8_t* ip_bound = ip + length - 4; /* because readU32 */ + const uint8_t* ip_limit = ip + length - 12 - 1; + uint8_t* op = (uint8_t*)output; + + uint32_t htab[HASH_SIZE]; + uint32_t seq, hash; + + /* initializes hash table */ + for (hash = 0; hash < HASH_SIZE; ++hash) htab[hash] = 0; + + /* we start with literal copy */ + const uint8_t* anchor = ip; + ip += 2; + + /* main loop */ + while (FASTLZ_LIKELY(ip < ip_limit)) { + const uint8_t* ref; + uint32_t distance, cmp; + + /* find potential match */ + do { + seq = flz_readu32(ip) & 0xffffff; + hash = flz_hash(seq); + ref = ip_start + htab[hash]; + htab[hash] = ip - ip_start; + distance = ip - ref; + cmp = FASTLZ_LIKELY(distance < MAX_FARDISTANCE) ? flz_readu32(ref) & 0xffffff : 0x1000000; + if (FASTLZ_UNLIKELY(ip >= ip_limit)) break; + ++ip; + } while (seq != cmp); + + if (FASTLZ_UNLIKELY(ip >= ip_limit)) break; + + --ip; + + /* far, needs at least 5-byte match */ + if (distance >= MAX_L2_DISTANCE) { + if (ref[3] != ip[3] || ref[4] != ip[4]) { + ++ip; + continue; + } + } + + if (FASTLZ_LIKELY(ip > anchor)) { + op = flz_literals(ip - anchor, anchor, op); + } + + uint32_t len = flz_cmp(ref + 3, ip + 3, ip_bound); + op = flz2_match(len, distance, op); + + /* update the hash at match boundary */ + ip += len; + seq = flz_readu32(ip); + hash = flz_hash(seq & 0xffffff); + htab[hash] = ip++ - ip_start; + seq >>= 8; + hash = flz_hash(seq); + htab[hash] = ip++ - ip_start; + + anchor = ip; + } + + uint32_t copy = (uint8_t*)input + length - anchor; + op = flz_literals(copy, anchor, op); + + /* marker for fastlz2 */ + *(uint8_t*)output |= (1 << 5); + + return op - (uint8_t*)output; +} + +int fastlz2_decompress(const void* input, int length, void* output, int maxout) { + const uint8_t* ip = (const uint8_t*)input; + const uint8_t* ip_limit = ip + length; + const uint8_t* ip_bound = ip_limit - 2; + uint8_t* op = (uint8_t*)output; + uint8_t* op_limit = op + maxout; + uint32_t ctrl = (*ip++) & 31; + + while (1) { + if (ctrl >= 32) { + uint32_t len = (ctrl >> 5) - 1; + uint32_t ofs = (ctrl & 31) << 8; + const uint8_t* ref = op - ofs - 1; + + uint8_t code; + if (len == 7 - 1) do { + FASTLZ_BOUND_CHECK(ip <= ip_bound); + code = *ip++; + len += code; + } while (code == 255); + code = *ip++; + ref -= code; + len += 3; + + /* match from 16-bit distance */ + if (FASTLZ_UNLIKELY(code == 255)) + if (FASTLZ_LIKELY(ofs == (31 << 8))) { + FASTLZ_BOUND_CHECK(ip < ip_bound); + ofs = (*ip++) << 8; + ofs += *ip++; + ref = op - ofs - MAX_L2_DISTANCE - 1; + } + + FASTLZ_BOUND_CHECK(op + len <= op_limit); + FASTLZ_BOUND_CHECK(ref >= (uint8_t*)output); + fastlz_memmove(op, ref, len); + op += len; + } else { + ctrl++; + FASTLZ_BOUND_CHECK(op + ctrl <= op_limit); + FASTLZ_BOUND_CHECK(ip + ctrl <= ip_limit); + fastlz_memcpy(op, ip, ctrl); + ip += ctrl; + op += ctrl; + } + + if (FASTLZ_UNLIKELY(ip >= ip_limit)) break; + ctrl = *ip++; + } + + return op - (uint8_t*)output; +} + +int fastlz_compress(const void* input, int length, void* output) { + /* for short block, choose fastlz1 */ + if (length < 65536) return fastlz1_compress(input, length, output); + + /* else... */ + return fastlz2_compress(input, length, output); +} + +int fastlz_decompress(const void* input, int length, void* output, int maxout) { + /* magic identifier for compression level */ + int level = ((*(const uint8_t*)input) >> 5) + 1; + + if (level == 1) return fastlz1_decompress(input, length, output, maxout); + if (level == 2) return fastlz2_decompress(input, length, output, maxout); + + /* unknown level, trigger error */ + return 0; +} + +int fastlz_compress_level(int level, const void* input, int length, void* output) { + if (level == 1) return fastlz1_compress(input, length, output); + if (level == 2) return fastlz2_compress(input, length, output); + + return 0; +} + +#pragma GCC diagnostic pop diff --git a/op-e2e/fastlz/fastlz.go b/op-e2e/fastlz/fastlz.go new file mode 100644 index 00000000000..0976ae455a5 --- /dev/null +++ b/op-e2e/fastlz/fastlz.go @@ -0,0 +1,31 @@ +package fastlz + +// #include +// #include "fastlz.h" +import "C" + +import ( + "errors" + "unsafe" +) + +// Compress compresses the input data using the FastLZ algorithm. +// The version of FastLZ used is FastLZ level 1 with the implementation from +// this commit: https://github.com/ariya/FastLZ/commit/344eb4025f9ae866ebf7a2ec48850f7113a97a42 +// Which is the same commit that Solady uses: https://github.com/Vectorized/solady/blob/main/src/utils/LibZip.sol#L19 +// Note the FastLZ compression ratio does vary between different versions of the library. +func Compress(input []byte) ([]byte, error) { + length := len(input) + if length == 0 { + return nil, errors.New("no input provided") + } + + result := make([]byte, length*2) + size := C.fastlz_compress(unsafe.Pointer(&input[0]), C.int(length), unsafe.Pointer(&result[0])) + + if size == 0 { + return nil, errors.New("error compressing data") + } + + return result[:size], nil +} diff --git a/op-e2e/fastlz/fastlz.h b/op-e2e/fastlz/fastlz.h new file mode 100644 index 00000000000..9172d74de10 --- /dev/null +++ b/op-e2e/fastlz/fastlz.h @@ -0,0 +1,97 @@ +/* + FastLZ - Byte-aligned LZ77 compression library + Copyright (C) 2005-2020 Ariya Hidayat + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ + +#ifndef FASTLZ_H +#define FASTLZ_H + +#define FASTLZ_VERSION 0x000500 + +#define FASTLZ_VERSION_MAJOR 0 +#define FASTLZ_VERSION_MINOR 5 +#define FASTLZ_VERSION_REVISION 0 + +#define FASTLZ_VERSION_STRING "0.5.0" + +#if defined(__cplusplus) +extern "C" { +#endif + +/** + Compress a block of data in the input buffer and returns the size of + compressed block. The size of input buffer is specified by length. The + minimum input buffer size is 16. + + The output buffer must be at least 5% larger than the input buffer + and can not be smaller than 66 bytes. + + If the input is not compressible, the return value might be larger than + length (input buffer size). + + The input buffer and the output buffer can not overlap. + + Compression level can be specified in parameter level. At the moment, + only level 1 and level 2 are supported. + Level 1 is the fastest compression and generally useful for short data. + Level 2 is slightly slower but it gives better compression ratio. + + Note that the compressed data, regardless of the level, can always be + decompressed using the function fastlz_decompress below. +*/ + +int fastlz_compress_level(int level, const void* input, int length, void* output); + +/** + Decompress a block of compressed data and returns the size of the + decompressed block. If error occurs, e.g. the compressed data is + corrupted or the output buffer is not large enough, then 0 (zero) + will be returned instead. + + The input buffer and the output buffer can not overlap. + + Decompression is memory safe and guaranteed not to write the output buffer + more than what is specified in maxout. + + Note that the decompression will always work, regardless of the + compression level specified in fastlz_compress_level above (when + producing the compressed block). + */ + +int fastlz_decompress(const void* input, int length, void* output, int maxout); + +/** + DEPRECATED. + + This is similar to fastlz_compress_level above, but with the level + automatically chosen. + + This function is deprecated and it will be completely removed in some future + version. +*/ + +int fastlz_compress(const void* input, int length, void* output); + +#if defined(__cplusplus) +} +#endif + +#endif /* FASTLZ_H */ diff --git a/op-e2e/fastlz_test.go b/op-e2e/fastlz_test.go index 9394abaa874..1ccad9db13f 100644 --- a/op-e2e/fastlz_test.go +++ b/op-e2e/fastlz_test.go @@ -10,14 +10,26 @@ import ( "github.com/ethereum-optimism/optimism/op-bindings/bindings" "github.com/ethereum-optimism/optimism/op-bindings/predeploys" + "github.com/ethereum-optimism/optimism/op-e2e/fastlz" + "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient/simulated" "github.com/ethereum/go-ethereum/params" "github.com/stretchr/testify/require" ) +var ( + contract = &bind.MetaData{ + ABI: "[{\"type\":\"function\",\"name\":\"fastLz\",\"inputs\":[{\"name\":\"_data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"}]", + } + + fastLzBytecode = "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063920a769114610030575b600080fd5b61004361003e366004610374565b610055565b60405190815260200160405180910390f35b600061006082610067565b5192915050565b60606101e0565b818153600101919050565b600082840393505b838110156100a25782810151828201511860001a1590930292600101610081565b9392505050565b825b602082106100d75782516100c0601f8361006e565b5260209290920191601f19909101906021016100ab565b81156100a25782516100ec600184038361006e565b520160010192915050565b60006001830392505b61010782106101385761012a8360ff1661012560fd6101258760081c60e0018961006e565b61006e565b935061010682039150610100565b600782106101655761015e8360ff16610125600785036101258760081c60e0018961006e565b90506100a2565b61017e8360ff166101258560081c8560051b018761006e565b949350505050565b80516101d890838303906101bc90600081901a600182901a60081b1760029190911a60101b17639e3779b90260131c611fff1690565b8060021b6040510182815160e01c1860e01b8151188152505050565b600101919050565b5060405161800038823961800081016020830180600d8551820103826002015b81811015610313576000805b50508051604051600082901a600183901a60081b1760029290921a60101b91909117639e3779b9810260111c617ffc16909101805160e081811c878603811890911b9091189091528401908183039084841061026857506102a3565b600184019350611fff821161029d578251600081901a600182901a60081b1760029190911a60101b17810361029d57506102a3565b5061020c565b8383106102b1575050610313565b600183039250858311156102cf576102cc87878886036100a9565b96505b6102e3600985016003850160038501610079565b91506102f08782846100f7565b9650506103088461030386848601610186565b610186565b915050809350610200565b5050617fe061032884848589518601036100a9565b03925050506020820180820383525b81811161034e57617fe08101518152602001610337565b5060008152602001604052919050565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561038657600080fd5b813567ffffffffffffffff8082111561039e57600080fd5b818401915084601f8301126103b257600080fd5b8135818111156103c4576103c461035e565b604051601f8201601f19908116603f011681019083821181831017156103ec576103ec61035e565b8160405282815287602084870101111561040557600080fd5b82602086016020830137600092810160200192909252509594505050505056fea264697066735822122000646b2953fc4a6f501bd0456ac52203089443937719e16b3190b7979c39511264736f6c63430008190033" +) + type testStateGetter struct { baseFee, blobBaseFee, overhead, scalar *big.Int baseFeeScalar, blobBaseFeeScalar uint32 @@ -147,3 +159,52 @@ func FuzzFjordCostFunction(f *testing.F) { }) } + +func FuzzFastLzGethSolidity(f *testing.F) { + a, err := contract.GetAbi() + require.NoError(f, err) + + b := simulated.NewBackend(map[common.Address]core.GenesisAccount{ + predeploys.GasPriceOracleAddr: { + Code: common.FromHex(fastLzBytecode), + }, + }) + defer func() { + require.NoError(f, b.Close()) + }() + + client := b.Client() + + f.Fuzz(func(t *testing.T, data []byte) { + req, err := a.Pack("fastLz", data) + require.NoError(t, err) + + response, err := client.CallContract(context.TODO(), ethereum.CallMsg{ + To: &predeploys.GasPriceOracleAddr, + Data: req, + }, nil) + require.NoError(t, err) + + result, err := a.Unpack("fastLz", response) + require.NoError(t, err) + + gethCompressedLen := types.FlzCompressLen(data) + require.Equal(t, result[0].(*big.Int).Uint64(), uint64(gethCompressedLen)) + }) +} + +func FuzzFastLzCgo(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + if len(data) == 0 { + t.Skip() + return + } + + // Our implementation in go-ethereum + compressedLen := types.FlzCompressLen(data) + + out, err := fastlz.Compress(data) + require.NoError(t, err) + require.Equal(t, int(compressedLen), len(out)) + }) +} diff --git a/op-e2e/system_test.go b/op-e2e/system_test.go index 18c976e7f39..eb03bc3d317 100644 --- a/op-e2e/system_test.go +++ b/op-e2e/system_test.go @@ -1376,10 +1376,10 @@ func testFees(t *testing.T, cfg SystemConfig) { // The tx fastlz size is 102, but the GPO calculation adds extra 68 bytes for the signature // --- Fjord cost function: --- // linear regression: -42.5856 + 102 * 0.8365 = 42 - // As this value is below the min txn size of 71, we use 71 for calculating the cost + // As this value is below the min txn size , we use he minimum for calculating the cost // --- GPO: --- // linear regression: -42.5856 + 170 * 0.8365 = 99 - // For GPO the linear regression output is above 71 due to the signature, so we use that instead + // For GPO the linear regression output is above the minimum size due to the signature, so we use that instead // There isn't an easy way to remove the overhead due to clamping. The below is a simple reimplementation // of the solidity calculation. diff --git a/op-service/eth/types.go b/op-service/eth/types.go index 7fe3d3433b4..71d442fa54b 100644 --- a/op-service/eth/types.go +++ b/op-service/eth/types.go @@ -28,7 +28,7 @@ const ( var ErrBedrockScalarPaddingNotEmpty = errors.New("version 0 scalar value has non-empty padding") -// InputError distinguishes a user-input error from regular rpc errors, +// InputError distinguishes an user-input error from regular rpc errors, // to help the (Engine) API user divert from accidental input mistakes. type InputError struct { Inner error From 1116cc1e64758d9515c2266f6a8ee46651bc3834 Mon Sep 17 00:00:00 2001 From: Danyal Prout Date: Sat, 11 May 2024 10:10:57 +0100 Subject: [PATCH 11/14] Review feedback --- go.mod | 10 +- go.sum | 21 ++-- op-bindings/bindings/gaspriceoracle.go | 2 +- op-e2e/actions/fjord_fork_test.go | 67 +++++-------- op-e2e/fastlz/fastlz.c | 3 + op-e2e/fastlz/fastlz.h | 3 + op-e2e/fastlz_test.go | 45 +++++++-- op-e2e/system_test.go | 41 ++------ op-node/chaincfg/chains_test.go | 5 +- .../derive/fjord_upgrade_transactions.go | 7 +- op-node/rollup/derive/system_config.go | 10 +- op-node/rollup/types_test.go | 96 ++++++++++++++++--- op-service/eth/types.go | 56 ----------- .../contracts-bedrock/scripts/L2Genesis.s.sol | 1 - 14 files changed, 179 insertions(+), 188 deletions(-) diff --git a/go.mod b/go.mod index c1a5fec46c4..8975e5fa90e 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( github.com/jackc/pgx/v5 v5.5.5 github.com/libp2p/go-libp2p v0.32.0 github.com/libp2p/go-libp2p-mplex v0.9.0 - github.com/libp2p/go-libp2p-pubsub v0.10.0 + github.com/libp2p/go-libp2p-pubsub v0.10.1 github.com/libp2p/go-libp2p-testing v0.12.0 github.com/mattn/go-isatty v0.0.20 github.com/minio/minio-go/v7 v7.0.70 @@ -47,10 +47,10 @@ require ( github.com/prometheus/client_golang v1.19.0 github.com/stretchr/testify v1.9.0 github.com/urfave/cli/v2 v2.27.1 - golang.org/x/crypto v0.21.0 + golang.org/x/crypto v0.23.0 golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 golang.org/x/sync v0.6.0 - golang.org/x/term v0.18.0 + golang.org/x/term v0.20.0 golang.org/x/time v0.5.0 gorm.io/driver/postgres v1.5.7 gorm.io/gorm v1.25.10 @@ -215,8 +215,8 @@ require ( go.uber.org/zap v1.26.0 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.23.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect golang.org/x/tools v0.17.0 // indirect google.golang.org/protobuf v1.32.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/go.sum b/go.sum index ada12a4f1ad..5fded1b48bf 100644 --- a/go.sum +++ b/go.sum @@ -507,8 +507,8 @@ github.com/libp2p/go-libp2p-asn-util v0.3.0 h1:gMDcMyYiZKkocGXDQ5nsUQyquC9+H+iLE github.com/libp2p/go-libp2p-asn-util v0.3.0/go.mod h1:B1mcOrKUE35Xq/ASTmQ4tN3LNzVVaMNmq2NACuqyB9w= github.com/libp2p/go-libp2p-mplex v0.9.0 h1:R58pDRAmuBXkYugbSSXR9wrTX3+1pFM1xP2bLuodIq8= github.com/libp2p/go-libp2p-mplex v0.9.0/go.mod h1:ro1i4kuwiFT+uMPbIDIFkcLs1KRbNp0QwnUXM+P64Og= -github.com/libp2p/go-libp2p-pubsub v0.10.0 h1:wS0S5FlISavMaAbxyQn3dxMOe2eegMfswM471RuHJwA= -github.com/libp2p/go-libp2p-pubsub v0.10.0/go.mod h1:1OxbaT/pFRO5h+Dpze8hdHQ63R0ke55XTs6b6NwLLkw= +github.com/libp2p/go-libp2p-pubsub v0.10.1 h1:/RqOZpEtAolsr8/9CC8KqROJSOZeu7lK7fPftn4MwNg= +github.com/libp2p/go-libp2p-pubsub v0.10.1/go.mod h1:1OxbaT/pFRO5h+Dpze8hdHQ63R0ke55XTs6b6NwLLkw= github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA= github.com/libp2p/go-libp2p-testing v0.12.0/go.mod h1:KcGDRXyN7sQCllucn1cOOS+Dmm7ujhfEyXQL5lvkcPg= github.com/libp2p/go-mplex v0.7.0 h1:BDhFZdlk5tbr0oyFq/xv/NPGfjbnrsDam1EvutpBDbY= @@ -868,8 +868,8 @@ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 h1:hNQpMuAJe5CtcUqCXaWga3FHu+kQvCqcsoVaQgSV60o= golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= @@ -991,16 +991,16 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -1012,8 +1012,11 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +github.com/ethereum-optimism/op-geth v1.101315.1-rc.1 h1:/anTmTvsS4Ll9uJkhrldfQQcA+DF0b4aPz7E3b50cgw= +github.com/ethereum-optimism/op-geth v1.101315.1-rc.1/go.mod h1:VXVFzx1mr/JyJac5M4k5W/+0cqHZMkqKsIVDsOyj2rs= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/op-bindings/bindings/gaspriceoracle.go b/op-bindings/bindings/gaspriceoracle.go index 22422d286fb..00f3194cb6a 100644 --- a/op-bindings/bindings/gaspriceoracle.go +++ b/op-bindings/bindings/gaspriceoracle.go @@ -31,7 +31,7 @@ var ( // GasPriceOracleMetaData contains all meta data concerning the GasPriceOracle contract. var GasPriceOracleMetaData = &bind.MetaData{ ABI: "[{\"type\":\"function\",\"name\":\"DECIMALS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"baseFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"baseFeeScalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blobBaseFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blobBaseFeeScalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decimals\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"gasPrice\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getL1Fee\",\"inputs\":[{\"name\":\"_data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getL1FeeUpperBound\",\"inputs\":[{\"name\":\"_unsignedTxSize\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getL1GasUsed\",\"inputs\":[{\"name\":\"_data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isEcotone\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isFjord\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"l1BaseFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"overhead\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"scalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setEcotone\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setFjord\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"}]", - Bin: "0x608060405234801561001057600080fd5b50611951806100206000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80636ef25c3a116100b2578063de26c4a111610081578063f45e65d811610066578063f45e65d81461025b578063f820614014610263578063fe173b971461020d57600080fd5b8063de26c4a114610235578063f1c7a58b1461024857600080fd5b80636ef25c3a1461020d5780638e98b10614610213578063960e3a231461021b578063c59859181461022d57600080fd5b806349948e0e11610109578063519b4bd3116100ee578063519b4bd31461019f57806354fd4d50146101a757806368d5dca6146101f057600080fd5b806349948e0e1461016f5780634ef6e2241461018257600080fd5b80630c18c1621461013b57806322b90ab3146101565780632e0f262514610160578063313ce56714610168575b600080fd5b61014361026b565b6040519081526020015b60405180910390f35b61015e61038c565b005b610143600681565b6006610143565b61014361017d3660046113c6565b6105af565b60005461018f9060ff1681565b604051901515815260200161014d565b610143610600565b6101e36040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b60405161014d9190611495565b6101f8610661565b60405163ffffffff909116815260200161014d565b48610143565b61015e6106e6565b60005461018f90610100900460ff1681565b6101f861097a565b6101436102433660046113c6565b6109db565b610143610256366004611508565b610ad5565b610143610ba5565b610143610c98565b6000805460ff1615610304576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f47617350726963654f7261636c653a206f76657268656164282920697320646560448201527f707265636174656400000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611521565b905090565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040f919061153a565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e2073657420697345636f746f6e6520666c6160648201527f6700000000000000000000000000000000000000000000000000000000000000608482015260a4016102fb565b60005460ff1615610582576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a2045636f746f6e6520616c72656164792060448201527f616374697665000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60008054610100900460ff16156105e3576105dd6105cc83610cf9565b516105d890604461159f565b61101e565b92915050565b60005460ff16156105f7576105dd826110b0565b6105dd82611154565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106c2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038791906115b7565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa158015610745573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610769919061153a565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610823576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e20736574206973466a6f726420666c61670060648201526084016102fb565b60005460ff166108b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f47617350726963654f7261636c653a20466a6f72642063616e206f6e6c79206260448201527f65206163746976617465642061667465722045636f746f6e650000000000000060648201526084016102fb565b600054610100900460ff161561094c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f47617350726963654f7261636c653a20466a6f726420616c726561647920616360448201527f746976650000000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106c2573d6000803e3d6000fd5b60008054610100900460ff1615610a2257620f4240610a0d6109fc84610cf9565b51610a0890604461159f565b6112a8565b610a189060106115dd565b6105dd919061161a565b6000610a2d83611307565b60005490915060ff1615610a415792915050565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610aa0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac49190611521565b610ace908261159f565b9392505050565b60008054610100900460ff16610b6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f47617350726963654f7261636c653a206765744c314665655570706572426f7560448201527f6e64206f6e6c7920737570706f72747320466a6f72640000000000000000000060648201526084016102fb565b6000610b7a60ff8461161a565b610b84908461159f565b610b8f90601061159f565b610b9a90604461159f565b9050610ace8161101e565b6000805460ff1615610c39576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a207363616c61722829206973206465707260448201527f656361746564000000000000000000000000000000000000000000000000000060648201526084016102fb565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b6060610e90565b818153600101919050565b600082840393505b83811015610ace5782810151828201511860001a1590930292600101610d13565b825b60208210610d80578251610d4b601f83610d00565b52602092909201917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090910190602101610d36565b8115610ace578251610d956001840383610d00565b520160010192915050565b60006001830392505b6101078210610de157610dd38360ff16610dce60fd610dce8760081c60e00189610d00565b610d00565b935061010682039150610da9565b60078210610e0e57610e078360ff16610dce60078503610dce8760081c60e00189610d00565b9050610ace565b610e278360ff16610dce8560081c8560051b0187610d00565b949350505050565b610e88828203610e6c610e5c84600081518060001a8160011a60081b178160021a60101b17915050919050565b639e3779b90260131c611fff1690565b8060021b6040510182815160e01c1860e01b8151188152505050565b600101919050565b6180003860405139618000604051016020830180600d8551820103826002015b81811015610fc3576000805b50508051604051600082901a600183901a60081b1760029290921a60101b91909117639e3779b9810260111c617ffc16909101805160e081811c878603811890911b90911890915284019081830390848410610f185750610f53565b600184019350611fff8211610f4d578251600081901a600182901a60081b1760029190911a60101b178103610f4d5750610f53565b50610ebc565b838310610f61575050610fc3565b60018303925085831115610f7f57610f7c8787888603610d34565b96505b610f93600985016003850160038501610d0b565b9150610fa0878284610da0565b965050610fb884610fb386848601610e2f565b610e2f565b915050809350610eb0565b5050610fd58383848851850103610d34565b925050506040519150618000820180820391508183526020830160005b8381101561100a578281015182820152602001610ff2565b506000920191825250602001604052919050565b60008061102a836112a8565b90506000611036610c98565b61103e610661565b63ffffffff1661104e91906115dd565b611056610600565b61105e61097a565b611069906010611655565b63ffffffff1661107991906115dd565b611083919061159f565b9050611091600660026115dd565b61109c90600a6117a1565b6110a682846115dd565b610e27919061161a565b6000806110bc83611307565b905060006110c8610600565b6110d061097a565b6110db906010611655565b63ffffffff166110eb91906115dd565b905060006110f7610c98565b6110ff610661565b63ffffffff1661110f91906115dd565b9050600061111d828461159f565b61112790856115dd565b90506111356006600a6117a1565b6111409060106115dd565b61114a908261161a565b9695505050505050565b60008061116083611307565b9050600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e79190611521565b6111ef610600565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa15801561124e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112729190611521565b61127c908561159f565b61128691906115dd565b61129091906115dd565b905061129e6006600a6117a1565b610e27908261161a565b6000806112b883620cc3946115dd565b6112e2907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd7632006117ad565b90506112f26064620f4240611821565b8112156105dd57610ace6064620f4240611821565b80516000908190815b8181101561138a5784818151811061132a5761132a6118dd565b01602001517fff000000000000000000000000000000000000000000000000000000000000001660000361136a5761136360048461159f565b9250611378565b61137560108461159f565b92505b806113828161190c565b915050611310565b50610e278261044061159f565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156113d857600080fd5b813567ffffffffffffffff808211156113f057600080fd5b818401915084601f83011261140457600080fd5b81358181111561141657611416611397565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561145c5761145c611397565b8160405282815287602084870101111561147557600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b818110156114c2578581018301518582016040015282016114a6565b818111156114d4576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60006020828403121561151a57600080fd5b5035919050565b60006020828403121561153357600080fd5b5051919050565b60006020828403121561154c57600080fd5b815173ffffffffffffffffffffffffffffffffffffffff81168114610ace57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082198211156115b2576115b2611570565b500190565b6000602082840312156115c957600080fd5b815163ffffffff81168114610ace57600080fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561161557611615611570565b500290565b600082611650577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600063ffffffff8083168185168183048111821515161561167857611678611570565b02949350505050565b600181815b808511156116da57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156116c0576116c0611570565b808516156116cd57918102915b93841c9390800290611686565b509250929050565b6000826116f1575060016105dd565b816116fe575060006105dd565b8160018114611714576002811461171e5761173a565b60019150506105dd565b60ff84111561172f5761172f611570565b50506001821b6105dd565b5060208310610133831016604e8410600b841016171561175d575081810a6105dd565b6117678383611681565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561179957611799611570565b029392505050565b6000610ace83836116e2565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038413811516156117e7576117e7611570565b827f800000000000000000000000000000000000000000000000000000000000000003841281161561181b5761181b611570565b50500190565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60008413600084138583048511828216161561186257611862611570565b7f8000000000000000000000000000000000000000000000000000000000000000600087128682058812818416161561189d5761189d611570565b600087129250878205871284841616156118b9576118b9611570565b878505871281841616156118cf576118cf611570565b505050929093029392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361193d5761193d611570565b506001019056fea164736f6c634300080f000a", + Bin: "0x608060405234801561001057600080fd5b506117f6806100206000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80636ef25c3a116100b2578063de26c4a111610081578063f45e65d811610066578063f45e65d81461025b578063f820614014610263578063fe173b971461020d57600080fd5b8063de26c4a114610235578063f1c7a58b1461024857600080fd5b80636ef25c3a1461020d5780638e98b10614610213578063960e3a231461021b578063c59859181461022d57600080fd5b806349948e0e11610109578063519b4bd3116100ee578063519b4bd31461019f57806354fd4d50146101a757806368d5dca6146101f057600080fd5b806349948e0e1461016f5780634ef6e2241461018257600080fd5b80630c18c1621461013b57806322b90ab3146101565780632e0f262514610160578063313ce56714610168575b600080fd5b61014361026b565b6040519081526020015b60405180910390f35b61015e61038c565b005b610143600681565b6006610143565b61014361017d3660046112a1565b610515565b60005461018f9060ff1681565b604051901515815260200161014d565b610143610552565b6101e36040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b60405161014d9190611370565b6101f86105b3565b60405163ffffffff909116815260200161014d565b48610143565b61015e610638565b60005461018f90610100900460ff1681565b6101f8610832565b6101436102433660046112a1565b610893565b6101436102563660046113e3565b61098d565b610143610a69565b610143610b5c565b6000805460ff1615610304576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f47617350726963654f7261636c653a206f76657268656164282920697320646560448201527f707265636174656400000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038791906113fc565b905090565b3373deaddeaddeaddeaddeaddeaddeaddeaddead000114610455576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e2073657420697345636f746f6e6520666c6160648201527f6700000000000000000000000000000000000000000000000000000000000000608482015260a4016102fb565b60005460ff16156104e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a2045636f746f6e6520616c72656164792060448201527f616374697665000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60008054610100900460ff16156105355761052f82610bbd565b92915050565b60005460ff16156105495761052f82610bdc565b61052f82610c80565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610614573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611415565b3373deaddeaddeaddeaddeaddeaddeaddeaddead0001146106db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e20736574206973466a6f726420666c61670060648201526084016102fb565b60005460ff1661076d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f47617350726963654f7261636c653a20466a6f72642063616e206f6e6c79206260448201527f65206163746976617465642061667465722045636f746f6e650000000000000060648201526084016102fb565b600054610100900460ff1615610804576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f47617350726963654f7261636c653a20466a6f726420616c726561647920616360448201527f746976650000000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610614573d6000803e3d6000fd5b60008054610100900460ff16156108da57620f42406108c56108b484610dd4565b516108c090604461146a565b6110f1565b6108d0906010611482565b61052f91906114bf565b60006108e583611150565b60005490915060ff16156108f95792915050565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610958573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097c91906113fc565b610986908261146a565b9392505050565b60008054610100900460ff16610a25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f47617350726963654f7261636c653a206765744c314665655570706572426f7560448201527f6e64206f6e6c7920737570706f72747320466a6f72640000000000000000000060648201526084016102fb565b6000610a3283604461146a565b90506000610a4160ff836114bf565b610a4b908361146a565b610a5690601061146a565b9050610a61816111e0565b949350505050565b6000805460ff1615610afd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a207363616c61722829206973206465707260448201527f656361746564000000000000000000000000000000000000000000000000000060648201526084016102fb565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600061052f610bcb83610dd4565b51610bd790604461146a565b6111e0565b600080610be883611150565b90506000610bf4610552565b610bfc610832565b610c079060106114fa565b63ffffffff16610c179190611482565b90506000610c23610b5c565b610c2b6105b3565b63ffffffff16610c3b9190611482565b90506000610c49828461146a565b610c539085611482565b9050610c616006600a611646565b610c6c906010611482565b610c7690826114bf565b9695505050505050565b600080610c8c83611150565b9050600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1391906113fc565b610d1b610552565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9e91906113fc565b610da8908561146a565b610db29190611482565b610dbc9190611482565b9050610dca6006600a611646565b610a6190826114bf565b6060610f63565b818153600101919050565b600082840393505b838110156109865782810151828201511860001a1590930292600101610dee565b825b60208210610e5b578251610e26601f83610ddb565b52602092909201917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090910190602101610e11565b8115610986578251610e706001840383610ddb565b520160010192915050565b60006001830392505b6101078210610ebc57610eae8360ff16610ea960fd610ea98760081c60e00189610ddb565b610ddb565b935061010682039150610e84565b60078210610ee957610ee28360ff16610ea960078503610ea98760081c60e00189610ddb565b9050610986565b610a618360ff16610ea98560081c8560051b0187610ddb565b610f5b828203610f3f610f2f84600081518060001a8160011a60081b178160021a60101b17915050919050565b639e3779b90260131c611fff1690565b8060021b6040510182815160e01c1860e01b8151188152505050565b600101919050565b6180003860405139618000604051016020830180600d8551820103826002015b81811015611096576000805b50508051604051600082901a600183901a60081b1760029290921a60101b91909117639e3779b9810260111c617ffc16909101805160e081811c878603811890911b90911890915284019081830390848410610feb5750611026565b600184019350611fff8211611020578251600081901a600182901a60081b1760029190911a60101b1781036110205750611026565b50610f8f565b838310611034575050611096565b600183039250858311156110525761104f8787888603610e0f565b96505b611066600985016003850160038501610de6565b9150611073878284610e7b565b96505061108b8461108686848601610f02565b610f02565b915050809350610f83565b50506110a88383848851850103610e0f565b925050506040519150618000820180820391508183526020830160005b838110156110dd5782810151828201526020016110c5565b506000920191825250602001604052919050565b60008061110183620cc394611482565b61112b907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd763200611652565b905061113b6064620f42406116c6565b81121561052f576109866064620f42406116c6565b80516000908190815b818110156111d35784818151811061117357611173611782565b01602001517fff00000000000000000000000000000000000000000000000000000000000000166000036111b3576111ac60048461146a565b92506111c1565b6111be60108461146a565b92505b806111cb816117b1565b915050611159565b50610a618261044061146a565b6000806111ec836110f1565b905060006111f8610b5c565b6112006105b3565b63ffffffff166112109190611482565b611218610552565b611220610832565b61122b9060106114fa565b63ffffffff1661123b9190611482565b611245919061146a565b905061125360066002611482565b61125e90600a611646565b6112688284611482565b610a6191906114bf565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156112b357600080fd5b813567ffffffffffffffff808211156112cb57600080fd5b818401915084601f8301126112df57600080fd5b8135818111156112f1576112f1611272565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561133757611337611272565b8160405282815287602084870101111561135057600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b8181101561139d57858101830151858201604001528201611381565b818111156113af576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b6000602082840312156113f557600080fd5b5035919050565b60006020828403121561140e57600080fd5b5051919050565b60006020828403121561142757600080fd5b815163ffffffff8116811461098657600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561147d5761147d61143b565b500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156114ba576114ba61143b565b500290565b6000826114f5577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600063ffffffff8083168185168183048111821515161561151d5761151d61143b565b02949350505050565b600181815b8085111561157f57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156115655761156561143b565b8085161561157257918102915b93841c939080029061152b565b509250929050565b6000826115965750600161052f565b816115a35750600061052f565b81600181146115b957600281146115c3576115df565b600191505061052f565b60ff8411156115d4576115d461143b565b50506001821b61052f565b5060208310610133831016604e8410600b8410161715611602575081810a61052f565b61160c8383611526565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561163e5761163e61143b565b029392505050565b60006109868383611587565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0384138115161561168c5761168c61143b565b827f80000000000000000000000000000000000000000000000000000000000000000384128116156116c0576116c061143b565b50500190565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000841360008413858304851182821616156117075761170761143b565b7f800000000000000000000000000000000000000000000000000000000000000060008712868205881281841616156117425761174261143b565b6000871292508782058712848416161561175e5761175e61143b565b878505871281841616156117745761177461143b565b505050929093029392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036117e2576117e261143b565b506001019056fea164736f6c634300080f000a", } // GasPriceOracleABI is the input ABI used to generate the binding from. diff --git a/op-e2e/actions/fjord_fork_test.go b/op-e2e/actions/fjord_fork_test.go index 5a56cf2cdda..2b80fe6fa42 100644 --- a/op-e2e/actions/fjord_fork_test.go +++ b/op-e2e/actions/fjord_fork_test.go @@ -6,6 +6,7 @@ import ( "math/big" "testing" + "github.com/ethereum-optimism/optimism/op-service/predeploys" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" @@ -15,7 +16,6 @@ import ( "github.com/stretchr/testify/require" "github.com/ethereum-optimism/optimism/op-bindings/bindings" - "github.com/ethereum-optimism/optimism/op-bindings/predeploys" "github.com/ethereum-optimism/optimism/op-chain-ops/genesis" "github.com/ethereum-optimism/optimism/op-e2e/e2eutils" "github.com/ethereum-optimism/optimism/op-node/rollup/derive" @@ -23,7 +23,7 @@ import ( ) var ( - fjordGasPriceOracleCodeHash = common.HexToHash("0x58e192326ee67ed52b7add91e4640024cbd1b21528a0ff1e1d21b7ca54e3ee62") + fjordGasPriceOracleCodeHash = common.HexToHash("0xa88fa50a2745b15e6794247614b5298483070661adacb8d32d716434ed24c6b2") // https://basescan.org/tx/0x8debb2fe54200183fb8baa3c6dbd8e6ec2e4f7a4add87416cd60336b8326d16a txHex = "02f875822105819b8405709fb884057d460082e97f94273ca93a52b817294830ed7572aa591ccfa647fd80881249c58b0021fb3fc080a05bb08ccfd68f83392e446dac64d88a2d28e7072c06502dfabc4a77e77b5c7913a05878d53dd4ebba4f6367e572d524dffcabeec3abb1d8725ee3ac5dc32e1852e3" ) @@ -32,8 +32,7 @@ func TestFjordNetworkUpgradeTransactions(gt *testing.T) { t := NewDefaultTesting(gt) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) genesisBlock := hexutil.Uint64(0) - ecotoneOffset := hexutil.Uint64(4) - fjordOffset := hexutil.Uint64(8) + fjordOffset := hexutil.Uint64(2) dp.DeployConfig.L1CancunTimeOffset = &genesisBlock // can be removed once Cancun on L1 is the default @@ -41,7 +40,7 @@ func TestFjordNetworkUpgradeTransactions(gt *testing.T) { dp.DeployConfig.L2GenesisRegolithTimeOffset = &genesisBlock dp.DeployConfig.L2GenesisCanyonTimeOffset = &genesisBlock dp.DeployConfig.L2GenesisDeltaTimeOffset = &genesisBlock - dp.DeployConfig.L2GenesisEcotoneTimeOffset = &ecotoneOffset + dp.DeployConfig.L2GenesisEcotoneTimeOffset = &genesisBlock dp.DeployConfig.L2GenesisFjordTimeOffset = &fjordOffset require.NoError(t, dp.DeployConfig.Check(), "must have valid config") @@ -50,10 +49,6 @@ func TestFjordNetworkUpgradeTransactions(gt *testing.T) { _, _, _, sequencer, engine, verifier, _, _ := setupReorgTestActors(t, dp, sd, log) ethCl := engine.EthClient() - // build a single block to move away from the genesis with 0-values in L1Block contract - sequencer.ActL2StartBlock(t) - sequencer.ActL2EndBlock(t) - // start op-nodes sequencer.ActL2PipelineFull(t) verifier.ActL2PipelineFull(t) @@ -62,8 +57,6 @@ func TestFjordNetworkUpgradeTransactions(gt *testing.T) { gasPriceOracle, err := bindings.NewGasPriceOracleCaller(predeploys.GasPriceOracleAddr, ethCl) require.NoError(t, err) - sequencer.ActBuildL2ToEcotone(t) - // Get current implementations addresses (by slot) for L1Block + GasPriceOracle initialGasPriceOracleAddress, err := ethCl.StorageAt(context.Background(), predeploys.GasPriceOracleAddr, genesis.ImplementationSlot, nil) require.NoError(t, err) @@ -107,41 +100,31 @@ func TestFjordNetworkUpgradeTransactions(gt *testing.T) { txData, err := hex.DecodeString(txHex) require.NoError(t, err) - l1GasUsed, err := gasPriceOracle.GetL1GasUsed(&bind.CallOpts{}, txData) + gpoL1GasUsed, err := gasPriceOracle.GetL1GasUsed(&bind.CallOpts{}, txData) require.NoError(t, err) - require.Equal(gt, uint64(1_888), l1GasUsed.Uint64()) - - fastLzSize := types.FlzCompressLen(txData) + require.Equal(gt, uint64(1_888), gpoL1GasUsed.Uint64()) // Check that GetL1Fee takes into account fast LZ - used, err := gasPriceOracle.GetL1Fee(&bind.CallOpts{}, txData) + gpoFee, err := gasPriceOracle.GetL1Fee(&bind.CallOpts{}, txData) require.NoError(t, err) - cost := fjordL1Cost(t, gasPriceOracle, int64(fastLzSize)) - require.Equal(t, cost.Uint64(), used.Uint64()) + gethFee := fjordL1Cost(t, gasPriceOracle, types.RollupCostData{ + FastLzSize: uint64(types.FlzCompressLen(txData) + 68), + }) + require.Equal(t, gethFee.Uint64(), gpoFee.Uint64()) - // Check that L1FeeUppberBound works + // Check that L1FeeUpperBound works upperBound, err := gasPriceOracle.GetL1FeeUpperBound(&bind.CallOpts{}, big.NewInt(int64(len(txData)))) require.NoError(t, err) - flzUpperBound := len(txData) + len(txData)/255 + 16 + txLen := len(txData) + 68 + flzUpperBound := uint64(txLen + txLen/255 + 16) - upperBoundCost := fjordL1Cost(t, gasPriceOracle, int64(flzUpperBound)) + upperBoundCost := fjordL1Cost(t, gasPriceOracle, types.RollupCostData{FastLzSize: flzUpperBound}) require.Equal(t, upperBoundCost.Uint64(), upperBound.Uint64()) } -// The new cost function: -// l1BaseFeeScaled = l1BaseFeeScalar * l1BaseFee * 16 -// l1BlobFeeScaled = l1BlobFeeScalar * l1BlobBaseFee -// l1FeeScaled = l1BaseFeeScaled + l1BlobFeeScaled -// ((intercept + fastlzCoef*max(fastlzLength, 100)) * l1FeeScaled) / 1e6 -func fjordL1Cost( - t require.TestingT, - gasPriceOracle *bindings.GasPriceOracleCaller, - fastLzLength int64, -) *big.Int { - fastLzLength = max(fastLzLength, types.MinTransactionSize.Int64()) - +func fjordL1Cost(t require.TestingT, gasPriceOracle *bindings.GasPriceOracleCaller, rollupCostData types.RollupCostData) *big.Int { baseFeeScalar, err := gasPriceOracle.BaseFeeScalar(nil) require.NoError(t, err) l1BaseFee, err := gasPriceOracle.L1BaseFee(nil) @@ -151,16 +134,12 @@ func fjordL1Cost( blobBaseFee, err := gasPriceOracle.BlobBaseFee(nil) require.NoError(t, err) - feeScaled := new(big.Int).Mul(new(big.Int).SetUint64(uint64(baseFeeScalar)), big.NewInt(16)) - feeScaled = new(big.Int).Mul(feeScaled, l1BaseFee) - feeScaled = new(big.Int).Add(feeScaled, new(big.Int).Mul(new(big.Int).SetUint64(uint64(blobBaseFeeScalar)), blobBaseFee)) - - cost := new(big.Int).Mul(types.L1CostFastlzCoef, new(big.Int).SetInt64(fastLzLength+68)) - cost = new(big.Int).Add(cost, types.L1CostIntercept) - require.True(t, cost.Sign() >= 0) - - cost = new(big.Int).Mul(cost, feeScaled) - cost = new(big.Int).Div(cost, new(big.Int).SetInt64(int64(1e12))) + costFunc := types.NewL1CostFuncFjord( + l1BaseFee, + blobBaseFee, + new(big.Int).SetUint64(uint64(baseFeeScalar)), + new(big.Int).SetUint64(uint64(blobBaseFeeScalar))) - return cost + fee, _ := costFunc(rollupCostData) + return fee } diff --git a/op-e2e/fastlz/fastlz.c b/op-e2e/fastlz/fastlz.c index 3e3a1549caf..c8c0fa4faef 100644 --- a/op-e2e/fastlz/fastlz.c +++ b/op-e2e/fastlz/fastlz.c @@ -19,6 +19,9 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + This implementation is taken from the following repository/commit: + https://github.com/ariya/FastLZ/tree/344eb4025f9ae866ebf7a2ec48850f7113a97a42 */ #include "fastlz.h" diff --git a/op-e2e/fastlz/fastlz.h b/op-e2e/fastlz/fastlz.h index 9172d74de10..4754d647573 100644 --- a/op-e2e/fastlz/fastlz.h +++ b/op-e2e/fastlz/fastlz.h @@ -19,6 +19,9 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + This implementation is taken from the following repository/commit: + https://github.com/ariya/FastLZ/tree/344eb4025f9ae866ebf7a2ec48850f7113a97a42 */ #ifndef FASTLZ_H diff --git a/op-e2e/fastlz_test.go b/op-e2e/fastlz_test.go index 1ccad9db13f..ad901e3f461 100644 --- a/op-e2e/fastlz_test.go +++ b/op-e2e/fastlz_test.go @@ -9,13 +9,12 @@ import ( "time" "github.com/ethereum-optimism/optimism/op-bindings/bindings" - "github.com/ethereum-optimism/optimism/op-bindings/predeploys" "github.com/ethereum-optimism/optimism/op-e2e/fastlz" + "github.com/ethereum-optimism/optimism/op-service/predeploys" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethclient/simulated" "github.com/ethereum/go-ethereum/params" @@ -23,11 +22,26 @@ import ( ) var ( + // This bytecode and ABI is for a contract, which wraps the LibZip library for easier fuzz testing. + // The source of this contract is here: https://github.com/danyalprout/fastlz/blob/main/src/FastLz.sol#L6-L10 contract = &bind.MetaData{ ABI: "[{\"type\":\"function\",\"name\":\"fastLz\",\"inputs\":[{\"name\":\"_data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"}]", } fastLzBytecode = "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063920a769114610030575b600080fd5b61004361003e366004610374565b610055565b60405190815260200160405180910390f35b600061006082610067565b5192915050565b60606101e0565b818153600101919050565b600082840393505b838110156100a25782810151828201511860001a1590930292600101610081565b9392505050565b825b602082106100d75782516100c0601f8361006e565b5260209290920191601f19909101906021016100ab565b81156100a25782516100ec600184038361006e565b520160010192915050565b60006001830392505b61010782106101385761012a8360ff1661012560fd6101258760081c60e0018961006e565b61006e565b935061010682039150610100565b600782106101655761015e8360ff16610125600785036101258760081c60e0018961006e565b90506100a2565b61017e8360ff166101258560081c8560051b018761006e565b949350505050565b80516101d890838303906101bc90600081901a600182901a60081b1760029190911a60101b17639e3779b90260131c611fff1690565b8060021b6040510182815160e01c1860e01b8151188152505050565b600101919050565b5060405161800038823961800081016020830180600d8551820103826002015b81811015610313576000805b50508051604051600082901a600183901a60081b1760029290921a60101b91909117639e3779b9810260111c617ffc16909101805160e081811c878603811890911b9091189091528401908183039084841061026857506102a3565b600184019350611fff821161029d578251600081901a600182901a60081b1760029190911a60101b17810361029d57506102a3565b5061020c565b8383106102b1575050610313565b600183039250858311156102cf576102cc87878886036100a9565b96505b6102e3600985016003850160038501610079565b91506102f08782846100f7565b9650506103088461030386848601610186565b610186565b915050809350610200565b5050617fe061032884848589518601036100a9565b03925050506020820180820383525b81811161034e57617fe08101518152602001610337565b5060008152602001604052919050565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561038657600080fd5b813567ffffffffffffffff8082111561039e57600080fd5b818401915084601f8301126103b257600080fd5b8135818111156103c4576103c461035e565b604051601f8201601f19908116603f011681019083821181831017156103ec576103ec61035e565b8160405282815287602084870101111561040557600080fd5b82602086016020830137600092810160200192909252509594505050505056fea264697066735822122000646b2953fc4a6f501bd0456ac52203089443937719e16b3190b7979c39511264736f6c63430008190033" + + seeds = [][]byte{ + // https: //basescan.org/tx/0x5dadeb52979f29fc7a7494c43fdabc5be1d8ff404f3aafe93d729fa8e5d00769 + common.Hex2Bytes("0xb9047c02f904788221050883036ee48409c6c87383037f6f941195cf65f83b3a5768f3c496d3a05ad6412c64b78644364c5bb000b90404d123b4d80000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000038000000000000000000000000000000000f6476f90447748c19248ccaa31e6b8bfda4eb9d830f5f47df7f0998f7c2123d9e6137761b75d3184efb0f788e3b14516000000000000000000000000000000000000000000000000000044364c5bb000000000000000000000000000f38e53bd45c8225a7c94b513beadaa7afe5d222d0000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084d6574614d61736b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035697066733a2f2f516d656852577a743347745961776343347564745657557233454c587261436746434259416b66507331696f48610000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000cd0d83d9e840f8e27d5c2e365fd365ff1c05b2480000000000000000000000000000000000000000000000000000000000000ce40000000000000000000000000000000000000000000000000000000000000041e4480d358dbae20880960a0a464d63b06565a0c9f9b1b37aa94b522247b23ce149c81359bf4239d1a879eeb41047ec710c15f5c0f67453da59a383e6abd742971c00000000000000000000000000000000000000000000000000000000000000c001a0b57f0ff8516ea29cb26a44ac5055a5420847d1e16a8e7b03b70f0c02291ff2d5a00ad3771e5f39ccacfff0faa8c5d25ef7a1c179f79e66e828ffddcb994c8b512e"), + // https://basescan.org/tx/0xfaada76a2dac09fc17f5a28d066aaabefc6d82ef6589b211ed8c9f766b070721 + common.Hex2Bytes("b87602f873822105528304320f8409cfe5c98252089480c67432656d59144ceff962e8faf8926599bcf888011dfe52d06b633f80c001a08632f069f837aea7a28bab0affee14dda116956bd5a850a355c045d25afedd17a0084b8f273efffe17ece527116053e5781a4915ff89ab9c379f1e62c25b697687"), + // https://basescan.org/tx/0x112864e9b971af6a1dac840018833c5a5a659acc187cfdaba919ad1da013678d + common.Hex2Bytes("b8b302f8b0822105308304320f8409cfe5c9827496944ed4e862860bed51a9570b96d89af5e1b0efefed80b844095ea7b3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba300000000000000000000000000000000000000000000015e10fb0973595fffffc001a02020e39f07917c1a852feb131c857e12478c7e88a20772b91a8bf5cee38c5aeea06055981727f9aaa3471c1af800555b35a77916c154be3f9d02ad1a63029455ab"), + // https://basescan.org/tx/0x6905051352691641888d0c427fb137c5b95afb5870d5169ff014eff1d0952195 + common.Hex2Bytes("b87202f86f8221058303dc6c8310db1f84068fa8d7838954409436af2ff952a7355c8045fcd5e88bc9f6c8257f7b8080c001a0b89e7ff3d7694109e73e7f4244e032581670313c36e48e485c9c94b853bd81d2a038ffaf8f10859ce21d1f7f7046c3d08027fb8aa15b69038f6102be97aaa1179a"), + // https://basescan.org/tx/0x6a38e9a26d7202a2268de69d2d47531c1a9829867579a483fb48d78e9e0b080d + common.Hex2Bytes("b9049b02f904978221058201618506fc23ac008506fc23ac008306ddd0943fc91a3afd70395cd496c647d5a6cc9d4b2b7fad80b904243593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006641d67b00000000000000000000000000000000000000000000000000000000000000030a000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000160000000000000000000000000088487bd8c3222d64d1d0b3fa7098dcf9d94d79e000000000000000000000000ffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000006669635d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fc91a3afd70395cd496c647d5a6cc9d4b2b7fad000000000000000000000000000000000000000000000000000000006641d78900000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000418661369ca026f92ff88347bd0e3625a7b5ed65071b366368c68ad7c55aed136c18659b34f9246e30a784227a53dd374fbd3d2124696808c678cd987c4e954a681b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000549e5c020c764dbfffff00000000000000000000000000000000000000000000000002e5a629c093a2b600000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002b088487bd8c3222d64d1d0b3fa7098dcf9d94d79e0027104200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000c001a014a3acef764ff6d3bb9bd81e420bfa94171a5734ab997dfbc9b41b653ce018a4a01ff5fccb01ef5c60ba3aef67d4e74f3f47312dd78bfbbff9e5090fbf2d3d62bb"), + } ) type testStateGetter struct { @@ -58,6 +72,10 @@ func (sg *testStateGetter) GetState(addr common.Address, slot common.Hash) commo } func FuzzFjordCostFunction(f *testing.F) { + for _, seed := range seeds { + f.Add(seed) + } + cfg := DefaultSystemConfig(f) s := hexutil.Uint64(0) cfg.DeployConfig.L2GenesisCanyonTimeOffset = &s @@ -145,8 +163,8 @@ func FuzzFjordCostFunction(f *testing.F) { l1FeeSolidity.Mul(l1FeeSolidity, big.NewInt(1e12)) l1FeeSolidity.Div(l1FeeSolidity, feeScaled) - totat := new(big.Int).Mul(big.NewInt(68), big.NewInt(836_500)) - l1FeeSolidity.Sub(l1FeeSolidity, totat) + totalAdjustment := new(big.Int).Mul(big.NewInt(68), big.NewInt(836_500)) + l1FeeSolidity.Sub(l1FeeSolidity, totalAdjustment) l1FeeSolidity.Mul(l1FeeSolidity, feeScaled) l1FeeSolidity.Div(l1FeeSolidity, big.NewInt(1e12)) @@ -157,14 +175,17 @@ func FuzzFjordCostFunction(f *testing.F) { require.Equal(t, l1FeeGeth.Uint64(), l1FeeSolidity.Uint64(), fmt.Sprintf("fuzzedData: %x", common.Bytes2Hex(fuzzedData))) }) - } func FuzzFastLzGethSolidity(f *testing.F) { - a, err := contract.GetAbi() + for _, seed := range seeds { + f.Add(seed) + } + + contractAbi, err := contract.GetAbi() require.NoError(f, err) - b := simulated.NewBackend(map[common.Address]core.GenesisAccount{ + b := simulated.NewBackend(map[common.Address]types.Account{ predeploys.GasPriceOracleAddr: { Code: common.FromHex(fastLzBytecode), }, @@ -176,16 +197,16 @@ func FuzzFastLzGethSolidity(f *testing.F) { client := b.Client() f.Fuzz(func(t *testing.T, data []byte) { - req, err := a.Pack("fastLz", data) + req, err := contractAbi.Pack("fastLz", data) require.NoError(t, err) - response, err := client.CallContract(context.TODO(), ethereum.CallMsg{ + response, err := client.CallContract(context.Background(), ethereum.CallMsg{ To: &predeploys.GasPriceOracleAddr, Data: req, }, nil) require.NoError(t, err) - result, err := a.Unpack("fastLz", response) + result, err := contractAbi.Unpack("fastLz", response) require.NoError(t, err) gethCompressedLen := types.FlzCompressLen(data) @@ -194,6 +215,10 @@ func FuzzFastLzGethSolidity(f *testing.F) { } func FuzzFastLzCgo(f *testing.F) { + for _, seed := range seeds { + f.Add(seed) + } + f.Fuzz(func(t *testing.T, data []byte) { if len(data) == 0 { t.Skip() diff --git a/op-e2e/system_test.go b/op-e2e/system_test.go index eb03bc3d317..97375be97d6 100644 --- a/op-e2e/system_test.go +++ b/op-e2e/system_test.go @@ -1373,38 +1373,15 @@ func testFees(t *testing.T, cfg SystemConfig) { adjustedGPOFee := gpoL1Fee if sys.RollupConfig.IsFjord(header.Time) { - // The tx fastlz size is 102, but the GPO calculation adds extra 68 bytes for the signature - // --- Fjord cost function: --- - // linear regression: -42.5856 + 102 * 0.8365 = 42 - // As this value is below the min txn size , we use he minimum for calculating the cost - // --- GPO: --- - // linear regression: -42.5856 + 170 * 0.8365 = 99 - // For GPO the linear regression output is above the minimum size due to the signature, so we use that instead - // There isn't an easy way to remove the overhead due to clamping. The below is a simple reimplementation - // of the solidity calculation. - - l1BaseFee, err := gpoContract.L1BaseFee(&bind.CallOpts{}) - require.NoError(t, err) - - baseFeeScalar, err := gpoContract.BaseFeeScalar(&bind.CallOpts{}) - require.NoError(t, err) - - blobBaseFeeScalar, err := gpoContract.BlobBaseFeeScalar(&bind.CallOpts{}) - require.NoError(t, err) - - blobBaseFee, err := gpoContract.BlobBaseFee(&bind.CallOpts{}) - require.NoError(t, err) - - feeScaled := new(big.Int).Mul(big.NewInt(int64(baseFeeScalar)), big.NewInt(16)) - feeScaled.Mul(feeScaled, l1BaseFee) - - blobFeeScaled := new(big.Int).Mul(big.NewInt(int64(blobBaseFeeScalar)), blobBaseFee) - feeScaled.Add(feeScaled, blobFeeScaled) - - result := new(big.Int).Mul(types.MinTransactionSizeScaled, feeScaled) - result.Div(result, big.NewInt(1e12)) - - adjustedGPOFee = result + // The fastlz size of the transaction is 102 bytes + require.Equal(t, uint64(102), tx.RollupCostData().FastLzSize) + // Which results in both the fjord cost function and GPO using the minimum value for the fastlz regression: + // Geth Linear Regression: -42.5856 + 102 * 0.8365 = 42.7374 + // GPO Linear Regression: -42.5856 + 170 * 0.8365 = 99.6194 + // The additional 68 (170 vs. 102) is due to the GPO adding 68 bytes to account for the signature. + require.Greater(t, types.MinTransactionSize.Uint64(), uint64(99)) + // Because of this, we don't need to do any adjustment as the GPO and cost func are both bounded to the minimum value. + // However, if the fastlz regression output is ever larger than the minimum, this will require an adjustment. } else if sys.RollupConfig.IsRegolith(header.Time) { // if post-regolith, adjust the GPO fee by removing the overhead it adds because of signature data artificialGPOOverhead := big.NewInt(68 * 16) // it adds 68 bytes to cover signature and RLP data diff --git a/op-node/chaincfg/chains_test.go b/op-node/chaincfg/chains_test.go index 2e90915e1b8..6b1c1497552 100644 --- a/op-node/chaincfg/chains_test.go +++ b/op-node/chaincfg/chains_test.go @@ -4,11 +4,10 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/stretchr/testify/require" - "github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-service/eth" + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/require" ) // TestGetRollupConfig tests that the configs sourced from the superchain-registry match diff --git a/op-node/rollup/derive/fjord_upgrade_transactions.go b/op-node/rollup/derive/fjord_upgrade_transactions.go index 31f16282e20..ba62e6c61b9 100644 --- a/op-node/rollup/derive/fjord_upgrade_transactions.go +++ b/op-node/rollup/derive/fjord_upgrade_transactions.go @@ -3,19 +3,18 @@ package derive import ( "math/big" + "github.com/ethereum-optimism/optimism/op-service/predeploys" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" - - "github.com/ethereum-optimism/optimism/op-bindings/predeploys" ) var ( // Gas Price Oracle Parameters deployFjordGasPriceOracleSource = UpgradeDepositSource{Intent: "Fjord: Gas Price Oracle Deployment"} GasPriceOracleFjordDeployerAddress = common.HexToAddress("0x4210000000000000000000000000000000000002") - gasPriceOracleFjordDeploymentBytecode = common.FromHex("0x608060405234801561001057600080fd5b50611951806100206000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80636ef25c3a116100b2578063de26c4a111610081578063f45e65d811610066578063f45e65d81461025b578063f820614014610263578063fe173b971461020d57600080fd5b8063de26c4a114610235578063f1c7a58b1461024857600080fd5b80636ef25c3a1461020d5780638e98b10614610213578063960e3a231461021b578063c59859181461022d57600080fd5b806349948e0e11610109578063519b4bd3116100ee578063519b4bd31461019f57806354fd4d50146101a757806368d5dca6146101f057600080fd5b806349948e0e1461016f5780634ef6e2241461018257600080fd5b80630c18c1621461013b57806322b90ab3146101565780632e0f262514610160578063313ce56714610168575b600080fd5b61014361026b565b6040519081526020015b60405180910390f35b61015e61038c565b005b610143600681565b6006610143565b61014361017d3660046113c6565b6105af565b60005461018f9060ff1681565b604051901515815260200161014d565b610143610600565b6101e36040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b60405161014d9190611495565b6101f8610661565b60405163ffffffff909116815260200161014d565b48610143565b61015e6106e6565b60005461018f90610100900460ff1681565b6101f861097a565b6101436102433660046113c6565b6109db565b610143610256366004611508565b610ad5565b610143610ba5565b610143610c98565b6000805460ff1615610304576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f47617350726963654f7261636c653a206f76657268656164282920697320646560448201527f707265636174656400000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611521565b905090565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040f919061153a565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e2073657420697345636f746f6e6520666c6160648201527f6700000000000000000000000000000000000000000000000000000000000000608482015260a4016102fb565b60005460ff1615610582576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a2045636f746f6e6520616c72656164792060448201527f616374697665000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60008054610100900460ff16156105e3576105dd6105cc83610cf9565b516105d890604461159f565b61101e565b92915050565b60005460ff16156105f7576105dd826110b0565b6105dd82611154565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106c2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038791906115b7565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663e591b2826040518163ffffffff1660e01b8152600401602060405180830381865afa158015610745573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610769919061153a565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610823576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e20736574206973466a6f726420666c61670060648201526084016102fb565b60005460ff166108b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f47617350726963654f7261636c653a20466a6f72642063616e206f6e6c79206260448201527f65206163746976617465642061667465722045636f746f6e650000000000000060648201526084016102fb565b600054610100900460ff161561094c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f47617350726963654f7261636c653a20466a6f726420616c726561647920616360448201527f746976650000000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106c2573d6000803e3d6000fd5b60008054610100900460ff1615610a2257620f4240610a0d6109fc84610cf9565b51610a0890604461159f565b6112a8565b610a189060106115dd565b6105dd919061161a565b6000610a2d83611307565b60005490915060ff1615610a415792915050565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610aa0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac49190611521565b610ace908261159f565b9392505050565b60008054610100900460ff16610b6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f47617350726963654f7261636c653a206765744c314665655570706572426f7560448201527f6e64206f6e6c7920737570706f72747320466a6f72640000000000000000000060648201526084016102fb565b6000610b7a60ff8461161a565b610b84908461159f565b610b8f90601061159f565b610b9a90604461159f565b9050610ace8161101e565b6000805460ff1615610c39576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a207363616c61722829206973206465707260448201527f656361746564000000000000000000000000000000000000000000000000000060648201526084016102fb565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b6060610e90565b818153600101919050565b600082840393505b83811015610ace5782810151828201511860001a1590930292600101610d13565b825b60208210610d80578251610d4b601f83610d00565b52602092909201917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090910190602101610d36565b8115610ace578251610d956001840383610d00565b520160010192915050565b60006001830392505b6101078210610de157610dd38360ff16610dce60fd610dce8760081c60e00189610d00565b610d00565b935061010682039150610da9565b60078210610e0e57610e078360ff16610dce60078503610dce8760081c60e00189610d00565b9050610ace565b610e278360ff16610dce8560081c8560051b0187610d00565b949350505050565b610e88828203610e6c610e5c84600081518060001a8160011a60081b178160021a60101b17915050919050565b639e3779b90260131c611fff1690565b8060021b6040510182815160e01c1860e01b8151188152505050565b600101919050565b6180003860405139618000604051016020830180600d8551820103826002015b81811015610fc3576000805b50508051604051600082901a600183901a60081b1760029290921a60101b91909117639e3779b9810260111c617ffc16909101805160e081811c878603811890911b90911890915284019081830390848410610f185750610f53565b600184019350611fff8211610f4d578251600081901a600182901a60081b1760029190911a60101b178103610f4d5750610f53565b50610ebc565b838310610f61575050610fc3565b60018303925085831115610f7f57610f7c8787888603610d34565b96505b610f93600985016003850160038501610d0b565b9150610fa0878284610da0565b965050610fb884610fb386848601610e2f565b610e2f565b915050809350610eb0565b5050610fd58383848851850103610d34565b925050506040519150618000820180820391508183526020830160005b8381101561100a578281015182820152602001610ff2565b506000920191825250602001604052919050565b60008061102a836112a8565b90506000611036610c98565b61103e610661565b63ffffffff1661104e91906115dd565b611056610600565b61105e61097a565b611069906010611655565b63ffffffff1661107991906115dd565b611083919061159f565b9050611091600660026115dd565b61109c90600a6117a1565b6110a682846115dd565b610e27919061161a565b6000806110bc83611307565b905060006110c8610600565b6110d061097a565b6110db906010611655565b63ffffffff166110eb91906115dd565b905060006110f7610c98565b6110ff610661565b63ffffffff1661110f91906115dd565b9050600061111d828461159f565b61112790856115dd565b90506111356006600a6117a1565b6111409060106115dd565b61114a908261161a565b9695505050505050565b60008061116083611307565b9050600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e79190611521565b6111ef610600565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa15801561124e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112729190611521565b61127c908561159f565b61128691906115dd565b61129091906115dd565b905061129e6006600a6117a1565b610e27908261161a565b6000806112b883620cc3946115dd565b6112e2907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd7632006117ad565b90506112f26064620f4240611821565b8112156105dd57610ace6064620f4240611821565b80516000908190815b8181101561138a5784818151811061132a5761132a6118dd565b01602001517fff000000000000000000000000000000000000000000000000000000000000001660000361136a5761136360048461159f565b9250611378565b61137560108461159f565b92505b806113828161190c565b915050611310565b50610e278261044061159f565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156113d857600080fd5b813567ffffffffffffffff808211156113f057600080fd5b818401915084601f83011261140457600080fd5b81358181111561141657611416611397565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561145c5761145c611397565b8160405282815287602084870101111561147557600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b818110156114c2578581018301518582016040015282016114a6565b818111156114d4576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60006020828403121561151a57600080fd5b5035919050565b60006020828403121561153357600080fd5b5051919050565b60006020828403121561154c57600080fd5b815173ffffffffffffffffffffffffffffffffffffffff81168114610ace57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082198211156115b2576115b2611570565b500190565b6000602082840312156115c957600080fd5b815163ffffffff81168114610ace57600080fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561161557611615611570565b500290565b600082611650577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600063ffffffff8083168185168183048111821515161561167857611678611570565b02949350505050565b600181815b808511156116da57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156116c0576116c0611570565b808516156116cd57918102915b93841c9390800290611686565b509250929050565b6000826116f1575060016105dd565b816116fe575060006105dd565b8160018114611714576002811461171e5761173a565b60019150506105dd565b60ff84111561172f5761172f611570565b50506001821b6105dd565b5060208310610133831016604e8410600b841016171561175d575081810a6105dd565b6117678383611681565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561179957611799611570565b029392505050565b6000610ace83836116e2565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038413811516156117e7576117e7611570565b827f800000000000000000000000000000000000000000000000000000000000000003841281161561181b5761181b611570565b50500190565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60008413600084138583048511828216161561186257611862611570565b7f8000000000000000000000000000000000000000000000000000000000000000600087128682058812818416161561189d5761189d611570565b600087129250878205871284841616156118b9576118b9611570565b878505871281841616156118cf576118cf611570565b505050929093029392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361193d5761193d611570565b506001019056fea164736f6c634300080f000a") + gasPriceOracleFjordDeploymentBytecode = common.FromHex("0x608060405234801561001057600080fd5b506117f6806100206000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80636ef25c3a116100b2578063de26c4a111610081578063f45e65d811610066578063f45e65d81461025b578063f820614014610263578063fe173b971461020d57600080fd5b8063de26c4a114610235578063f1c7a58b1461024857600080fd5b80636ef25c3a1461020d5780638e98b10614610213578063960e3a231461021b578063c59859181461022d57600080fd5b806349948e0e11610109578063519b4bd3116100ee578063519b4bd31461019f57806354fd4d50146101a757806368d5dca6146101f057600080fd5b806349948e0e1461016f5780634ef6e2241461018257600080fd5b80630c18c1621461013b57806322b90ab3146101565780632e0f262514610160578063313ce56714610168575b600080fd5b61014361026b565b6040519081526020015b60405180910390f35b61015e61038c565b005b610143600681565b6006610143565b61014361017d3660046112a1565b610515565b60005461018f9060ff1681565b604051901515815260200161014d565b610143610552565b6101e36040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b60405161014d9190611370565b6101f86105b3565b60405163ffffffff909116815260200161014d565b48610143565b61015e610638565b60005461018f90610100900460ff1681565b6101f8610832565b6101436102433660046112a1565b610893565b6101436102563660046113e3565b61098d565b610143610a69565b610143610b5c565b6000805460ff1615610304576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f47617350726963654f7261636c653a206f76657268656164282920697320646560448201527f707265636174656400000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038791906113fc565b905090565b3373deaddeaddeaddeaddeaddeaddeaddeaddead000114610455576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e2073657420697345636f746f6e6520666c6160648201527f6700000000000000000000000000000000000000000000000000000000000000608482015260a4016102fb565b60005460ff16156104e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a2045636f746f6e6520616c72656164792060448201527f616374697665000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60008054610100900460ff16156105355761052f82610bbd565b92915050565b60005460ff16156105495761052f82610bdc565b61052f82610c80565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610614573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611415565b3373deaddeaddeaddeaddeaddeaddeaddeaddead0001146106db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e20736574206973466a6f726420666c61670060648201526084016102fb565b60005460ff1661076d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f47617350726963654f7261636c653a20466a6f72642063616e206f6e6c79206260448201527f65206163746976617465642061667465722045636f746f6e650000000000000060648201526084016102fb565b600054610100900460ff1615610804576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f47617350726963654f7261636c653a20466a6f726420616c726561647920616360448201527f746976650000000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610614573d6000803e3d6000fd5b60008054610100900460ff16156108da57620f42406108c56108b484610dd4565b516108c090604461146a565b6110f1565b6108d0906010611482565b61052f91906114bf565b60006108e583611150565b60005490915060ff16156108f95792915050565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610958573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097c91906113fc565b610986908261146a565b9392505050565b60008054610100900460ff16610a25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f47617350726963654f7261636c653a206765744c314665655570706572426f7560448201527f6e64206f6e6c7920737570706f72747320466a6f72640000000000000000000060648201526084016102fb565b6000610a3283604461146a565b90506000610a4160ff836114bf565b610a4b908361146a565b610a5690601061146a565b9050610a61816111e0565b949350505050565b6000805460ff1615610afd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a207363616c61722829206973206465707260448201527f656361746564000000000000000000000000000000000000000000000000000060648201526084016102fb565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600061052f610bcb83610dd4565b51610bd790604461146a565b6111e0565b600080610be883611150565b90506000610bf4610552565b610bfc610832565b610c079060106114fa565b63ffffffff16610c179190611482565b90506000610c23610b5c565b610c2b6105b3565b63ffffffff16610c3b9190611482565b90506000610c49828461146a565b610c539085611482565b9050610c616006600a611646565b610c6c906010611482565b610c7690826114bf565b9695505050505050565b600080610c8c83611150565b9050600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1391906113fc565b610d1b610552565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9e91906113fc565b610da8908561146a565b610db29190611482565b610dbc9190611482565b9050610dca6006600a611646565b610a6190826114bf565b6060610f63565b818153600101919050565b600082840393505b838110156109865782810151828201511860001a1590930292600101610dee565b825b60208210610e5b578251610e26601f83610ddb565b52602092909201917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090910190602101610e11565b8115610986578251610e706001840383610ddb565b520160010192915050565b60006001830392505b6101078210610ebc57610eae8360ff16610ea960fd610ea98760081c60e00189610ddb565b610ddb565b935061010682039150610e84565b60078210610ee957610ee28360ff16610ea960078503610ea98760081c60e00189610ddb565b9050610986565b610a618360ff16610ea98560081c8560051b0187610ddb565b610f5b828203610f3f610f2f84600081518060001a8160011a60081b178160021a60101b17915050919050565b639e3779b90260131c611fff1690565b8060021b6040510182815160e01c1860e01b8151188152505050565b600101919050565b6180003860405139618000604051016020830180600d8551820103826002015b81811015611096576000805b50508051604051600082901a600183901a60081b1760029290921a60101b91909117639e3779b9810260111c617ffc16909101805160e081811c878603811890911b90911890915284019081830390848410610feb5750611026565b600184019350611fff8211611020578251600081901a600182901a60081b1760029190911a60101b1781036110205750611026565b50610f8f565b838310611034575050611096565b600183039250858311156110525761104f8787888603610e0f565b96505b611066600985016003850160038501610de6565b9150611073878284610e7b565b96505061108b8461108686848601610f02565b610f02565b915050809350610f83565b50506110a88383848851850103610e0f565b925050506040519150618000820180820391508183526020830160005b838110156110dd5782810151828201526020016110c5565b506000920191825250602001604052919050565b60008061110183620cc394611482565b61112b907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd763200611652565b905061113b6064620f42406116c6565b81121561052f576109866064620f42406116c6565b80516000908190815b818110156111d35784818151811061117357611173611782565b01602001517fff00000000000000000000000000000000000000000000000000000000000000166000036111b3576111ac60048461146a565b92506111c1565b6111be60108461146a565b92505b806111cb816117b1565b915050611159565b50610a618261044061146a565b6000806111ec836110f1565b905060006111f8610b5c565b6112006105b3565b63ffffffff166112109190611482565b611218610552565b611220610832565b61122b9060106114fa565b63ffffffff1661123b9190611482565b611245919061146a565b905061125360066002611482565b61125e90600a611646565b6112688284611482565b610a6191906114bf565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156112b357600080fd5b813567ffffffffffffffff808211156112cb57600080fd5b818401915084601f8301126112df57600080fd5b8135818111156112f1576112f1611272565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561133757611337611272565b8160405282815287602084870101111561135057600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b8181101561139d57858101830151858201604001528201611381565b818111156113af576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b6000602082840312156113f557600080fd5b5035919050565b60006020828403121561140e57600080fd5b5051919050565b60006020828403121561142757600080fd5b815163ffffffff8116811461098657600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561147d5761147d61143b565b500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156114ba576114ba61143b565b500290565b6000826114f5577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600063ffffffff8083168185168183048111821515161561151d5761151d61143b565b02949350505050565b600181815b8085111561157f57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156115655761156561143b565b8085161561157257918102915b93841c939080029061152b565b509250929050565b6000826115965750600161052f565b816115a35750600061052f565b81600181146115b957600281146115c3576115df565b600191505061052f565b60ff8411156115d4576115d461143b565b50506001821b61052f565b5060208310610133831016604e8410600b8410161715611602575081810a61052f565b61160c8383611526565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561163e5761163e61143b565b029392505050565b60006109868383611587565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0384138115161561168c5761168c61143b565b827f80000000000000000000000000000000000000000000000000000000000000000384128116156116c0576116c061143b565b50500190565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000841360008413858304851182821616156117075761170761143b565b7f800000000000000000000000000000000000000000000000000000000000000060008712868205881281841616156117425761174261143b565b6000871292508782058712848416161561175e5761175e61143b565b878505871281841616156117745761177461143b565b505050929093029392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036117e2576117e261143b565b506001019056fea164736f6c634300080f000a") // Update GasPricePriceOracle Proxy Parameters updateFjordGasPriceOracleSource = UpgradeDepositSource{Intent: "Fjord: Gas Price Oracle Proxy Update"} @@ -75,9 +74,11 @@ func FjordNetworkUpgradeTransactions() ([]hexutil.Bytes, error) { IsSystemTransaction: false, Data: enableFjordInput, }).MarshalBinary() + if err != nil { return nil, err } + upgradeTxns = append(upgradeTxns, enableFjord) return upgradeTxns, nil diff --git a/op-node/rollup/derive/system_config.go b/op-node/rollup/derive/system_config.go index 597fc6bbb1e..6b0dbe50411 100644 --- a/op-node/rollup/derive/system_config.go +++ b/op-node/rollup/derive/system_config.go @@ -111,15 +111,7 @@ func ProcessSystemConfigUpdateLogEvent(destSysCfg *eth.SystemConfig, ev *types.L if !solabi.EmptyReader(reader) { return NewCriticalError(errors.New("too many bytes")) } - if rollupCfg.IsFjord(l1Time) { - if err := eth.CheckFjordL1SystemConfigScalar(scalar); err != nil { - return nil // ignore invalid scalars, retain the old system-config scalar - } - // retain the scalar data in encoded form - destSysCfg.Scalar = scalar - // zero out the overhead, it will not affect the state-transition after Ecotone - destSysCfg.Overhead = eth.Bytes32{} - } else if rollupCfg.IsEcotone(l1Time) { + if rollupCfg.IsEcotone(l1Time) { if err := eth.CheckEcotoneL1SystemConfigScalar(scalar); err != nil { return nil // ignore invalid scalars, retain the old system-config scalar } diff --git a/op-node/rollup/types_test.go b/op-node/rollup/types_test.go index 6ba4323622b..aa09d1f5aee 100644 --- a/op-node/rollup/types_test.go +++ b/op-node/rollup/types_test.go @@ -180,21 +180,87 @@ func TestRandomConfigDescription(t *testing.T) { }) } -// TestRegolithActivation tests the activation condition of the Regolith upgrade. -func TestRegolithActivation(t *testing.T) { - config := randConfig() - config.RegolithTime = nil - require.False(t, config.IsRegolith(0), "false if nil time, even if checking 0") - require.False(t, config.IsRegolith(123456), "false if nil time") - config.RegolithTime = new(uint64) - require.True(t, config.IsRegolith(0), "true at zero") - require.True(t, config.IsRegolith(123456), "true for any") - x := uint64(123) - config.RegolithTime = &x - require.False(t, config.IsRegolith(0)) - require.False(t, config.IsRegolith(122)) - require.True(t, config.IsRegolith(123)) - require.True(t, config.IsRegolith(124)) +// TestActivations tests the activation condition of the various upgrades. +func TestActivations(t *testing.T) { + for _, test := range []struct { + name string + setUpgradeTime func(t *uint64, c *Config) + checkEnabled func(t uint64, c *Config) bool + }{ + { + name: "Regolith", + setUpgradeTime: func(t *uint64, c *Config) { + c.RegolithTime = t + }, + checkEnabled: func(t uint64, c *Config) bool { + return c.IsRegolith(t) + }, + }, + { + name: "Canyon", + setUpgradeTime: func(t *uint64, c *Config) { + c.CanyonTime = t + }, + checkEnabled: func(t uint64, c *Config) bool { + return c.IsCanyon(t) + }, + }, + { + name: "Delta", + setUpgradeTime: func(t *uint64, c *Config) { + c.DeltaTime = t + }, + checkEnabled: func(t uint64, c *Config) bool { + return c.IsDelta(t) + }, + }, + { + name: "Ecotone", + setUpgradeTime: func(t *uint64, c *Config) { + c.EcotoneTime = t + }, + checkEnabled: func(t uint64, c *Config) bool { + return c.IsEcotone(t) + }, + }, + { + name: "Fjord", + setUpgradeTime: func(t *uint64, c *Config) { + c.FjordTime = t + }, + checkEnabled: func(t uint64, c *Config) bool { + return c.IsFjord(t) + }, + }, + { + name: "Interop", + setUpgradeTime: func(t *uint64, c *Config) { + c.InteropTime = t + }, + checkEnabled: func(t uint64, c *Config) bool { + return c.IsInterop(t) + }, + }, + } { + tt := test + t.Run(fmt.Sprintf("TestActivations_%s", tt.name), func(t *testing.T) { + config := randConfig() + test.setUpgradeTime(nil, config) + require.False(t, tt.checkEnabled(0, config), "false if nil time, even if checking 0") + require.False(t, tt.checkEnabled(123456, config), "false if nil time") + + test.setUpgradeTime(new(uint64), config) + require.True(t, tt.checkEnabled(0, config), "true at zero") + require.True(t, tt.checkEnabled(123456, config), "true for any") + + x := uint64(123) + test.setUpgradeTime(&x, config) + require.False(t, tt.checkEnabled(0, config)) + require.False(t, tt.checkEnabled(122, config)) + require.True(t, tt.checkEnabled(123, config)) + require.True(t, tt.checkEnabled(124, config)) + }) + } } type mockL2Client struct { diff --git a/op-service/eth/types.go b/op-service/eth/types.go index 71d442fa54b..81a95fc968f 100644 --- a/op-service/eth/types.go +++ b/op-service/eth/types.go @@ -391,8 +391,6 @@ const ( L1ScalarBedrock = byte(0) // L1ScalarEcotone is new in Ecotone, allowing configuration of both a regular and a blobs scalar. L1ScalarEcotone = byte(1) - // L1ScalarFjord is new in Fjord, allowing the configuration of the linear regression formula. - L1ScalarFjord = byte(2) ) type EcotoneScalars struct { @@ -400,49 +398,6 @@ type EcotoneScalars struct { BaseFeeScalar uint32 } -type FjordScalars struct { - BlobBaseFeeScalar uint32 - BaseFeeScalar uint32 - CostIntercept int32 - CostFastLzCoef int32 -} - -func (sysCfg *SystemConfig) FjordScalars() (FjordScalars, error) { - if err := CheckFjordL1SystemConfigScalar(sysCfg.Scalar); err != nil { - if errors.Is(err, ErrBedrockScalarPaddingNotEmpty) { - // L2 spec mandates we set baseFeeScalar to MaxUint32 if there are non-zero bytes in - // the padding area. - return FjordScalars{ - BlobBaseFeeScalar: 0, - BaseFeeScalar: math.MaxUint32, - CostIntercept: 0, - CostFastLzCoef: 0, - }, nil - } - return FjordScalars{}, err - } - if sysCfg.Scalar[0] == L1ScalarFjord { - return FjordScalars{ - CostFastLzCoef: int32(binary.BigEndian.Uint32(sysCfg.Scalar[16:20])), - CostIntercept: int32(binary.BigEndian.Uint32(sysCfg.Scalar[20:24])), - BlobBaseFeeScalar: binary.BigEndian.Uint32(sysCfg.Scalar[24:28]), - BaseFeeScalar: binary.BigEndian.Uint32(sysCfg.Scalar[28:32]), - }, nil - } else { - ecotoneScalars, err := sysCfg.EcotoneScalars() - if err != nil { - return FjordScalars{}, err - } - - return FjordScalars{ - BlobBaseFeeScalar: ecotoneScalars.BlobBaseFeeScalar, - BaseFeeScalar: ecotoneScalars.BaseFeeScalar, - CostIntercept: 0, - CostFastLzCoef: 0, - }, nil - } -} - func (sysCfg *SystemConfig) EcotoneScalars() (EcotoneScalars, error) { if err := CheckEcotoneL1SystemConfigScalar(sysCfg.Scalar); err != nil { if errors.Is(err, ErrBedrockScalarPaddingNotEmpty) { @@ -502,17 +457,6 @@ func CheckEcotoneL1SystemConfigScalar(scalar [32]byte) error { } } -func CheckFjordL1SystemConfigScalar(scalar [32]byte) error { - versionByte := scalar[0] - if versionByte == L1ScalarFjord { - if ([11]byte)(scalar[1:12]) != ([11]byte{}) { // check padding - return fmt.Errorf("invalid version 2 scalar padding: %x", scalar[1:12]) - } - return nil - } - return CheckEcotoneL1SystemConfigScalar(scalar) -} - type Bytes48 [48]byte func (b *Bytes48) UnmarshalJSON(text []byte) error { diff --git a/packages/contracts-bedrock/scripts/L2Genesis.s.sol b/packages/contracts-bedrock/scripts/L2Genesis.s.sol index 99bb3a9f13a..6e12c897923 100644 --- a/packages/contracts-bedrock/scripts/L2Genesis.s.sol +++ b/packages/contracts-bedrock/scripts/L2Genesis.s.sol @@ -41,7 +41,6 @@ struct L1Dependencies { /// @custom:value LOCAL_LATEST Represents latest L2 allocs, not output anywhere, but kept in-process. /// @custom:value LOCAL_ECOTONE Represents Ecotone-upgrade L2 allocs, not output anywhere, but kept in-process. /// @custom:value LOCAL_DELTA Represents Delta-upgrade L2 allocs, not output anywhere, but kept in-process. -/// @custom:value LOCAL_ECOTONE Represents Ecotone-upgrade L2 allocs, not output anywhere, but kept in-process. /// @custom:value OUTPUT_ALL Represents creation of one L2 allocs file for every upgrade. enum OutputMode { DEFAULT_LATEST, From 03f6bea46009673714c14f22cf01bd799c57f0e7 Mon Sep 17 00:00:00 2001 From: Danyal Prout Date: Wed, 15 May 2024 18:19:49 +0100 Subject: [PATCH 12/14] Bump geth --- go.mod | 2 +- go.sum | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 8975e5fa90e..0559ae280ba 100644 --- a/go.mod +++ b/go.mod @@ -227,7 +227,7 @@ require ( rsc.io/tmplfunc v0.0.3 // indirect ) -replace github.com/ethereum/go-ethereum => github.com/ethereum-optimism/op-geth v1.101315.1-rc.2 +replace github.com/ethereum/go-ethereum => github.com/ethereum-optimism/op-geth v1.101315.1-rc.3 //replace github.com/ethereum/go-ethereum v1.13.9 => ../op-geth diff --git a/go.sum b/go.sum index 5fded1b48bf..9683e768596 100644 --- a/go.sum +++ b/go.sum @@ -175,8 +175,8 @@ github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/ github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z8veEq5ZO3DfIhZ7xgRP9WTc= github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs= -github.com/ethereum-optimism/op-geth v1.101315.1-rc.2 h1:uUrcs8fGrdDnVELB66GcMZRvwIeJow64DOtF+VFdAzY= -github.com/ethereum-optimism/op-geth v1.101315.1-rc.2/go.mod h1:VXVFzx1mr/JyJac5M4k5W/+0cqHZMkqKsIVDsOyj2rs= +github.com/ethereum-optimism/op-geth v1.101315.1-rc.3 h1:BvmzUehVSo7uuqtApy/h/A5uRDAuU2tJQLgHCWTxAUQ= +github.com/ethereum-optimism/op-geth v1.101315.1-rc.3/go.mod h1:VXVFzx1mr/JyJac5M4k5W/+0cqHZMkqKsIVDsOyj2rs= github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240510200259-4be7024d2ba7 h1:e7oXWZwODAMM2TLo9beGDXaX2cCw7uM7qAqamYBHV40= github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240510200259-4be7024d2ba7/go.mod h1:7xh2awFQqsiZxFrHKTgEd+InVfDRrkKVUIuK8SAFHp0= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= @@ -1015,8 +1015,6 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -github.com/ethereum-optimism/op-geth v1.101315.1-rc.1 h1:/anTmTvsS4Ll9uJkhrldfQQcA+DF0b4aPz7E3b50cgw= -github.com/ethereum-optimism/op-geth v1.101315.1-rc.1/go.mod h1:VXVFzx1mr/JyJac5M4k5W/+0cqHZMkqKsIVDsOyj2rs= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From dc2d4749312a35de5ee49387474c3d258f90f72d Mon Sep 17 00:00:00 2001 From: Danyal Prout Date: Thu, 16 May 2024 14:47:33 +0100 Subject: [PATCH 13/14] fix: ensure we don't gc the data during fastlz compression --- op-e2e/fastlz/fastlz.go | 3 +++ op-node/rollup/derive/fjord_upgrade_transactions.go | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/op-e2e/fastlz/fastlz.go b/op-e2e/fastlz/fastlz.go index 0976ae455a5..fc0a43cf3af 100644 --- a/op-e2e/fastlz/fastlz.go +++ b/op-e2e/fastlz/fastlz.go @@ -6,6 +6,7 @@ import "C" import ( "errors" + "runtime" "unsafe" ) @@ -23,6 +24,8 @@ func Compress(input []byte) ([]byte, error) { result := make([]byte, length*2) size := C.fastlz_compress(unsafe.Pointer(&input[0]), C.int(length), unsafe.Pointer(&result[0])) + runtime.KeepAlive(input) + if size == 0 { return nil, errors.New("error compressing data") } diff --git a/op-node/rollup/derive/fjord_upgrade_transactions.go b/op-node/rollup/derive/fjord_upgrade_transactions.go index ba62e6c61b9..93f7595dd1d 100644 --- a/op-node/rollup/derive/fjord_upgrade_transactions.go +++ b/op-node/rollup/derive/fjord_upgrade_transactions.go @@ -12,8 +12,13 @@ import ( var ( // Gas Price Oracle Parameters - deployFjordGasPriceOracleSource = UpgradeDepositSource{Intent: "Fjord: Gas Price Oracle Deployment"} - GasPriceOracleFjordDeployerAddress = common.HexToAddress("0x4210000000000000000000000000000000000002") + deployFjordGasPriceOracleSource = UpgradeDepositSource{Intent: "Fjord: Gas Price Oracle Deployment"} + GasPriceOracleFjordDeployerAddress = common.HexToAddress("0x4210000000000000000000000000000000000002") + // Fjord GPO Deployment bytecode generated from: + // 1. git checkout 52abfb507342191ae1f960b443ae8aec7598755c + // 2. pnpm clean && pnpm install && pnpm build + // 3. jq -r ".bytecode.object" packages/contracts-bedrock/forge-artifacts/GasPriceOracle.sol/GasPriceOracle.json + // https://github.com/ethereum-optimism/specs/blob/2dd412ce42171b4041e826fd6b8defacc88e8f56/specs/fjord/derivation.md#gaspriceoracle-deployment gasPriceOracleFjordDeploymentBytecode = common.FromHex("0x608060405234801561001057600080fd5b506117f6806100206000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80636ef25c3a116100b2578063de26c4a111610081578063f45e65d811610066578063f45e65d81461025b578063f820614014610263578063fe173b971461020d57600080fd5b8063de26c4a114610235578063f1c7a58b1461024857600080fd5b80636ef25c3a1461020d5780638e98b10614610213578063960e3a231461021b578063c59859181461022d57600080fd5b806349948e0e11610109578063519b4bd3116100ee578063519b4bd31461019f57806354fd4d50146101a757806368d5dca6146101f057600080fd5b806349948e0e1461016f5780634ef6e2241461018257600080fd5b80630c18c1621461013b57806322b90ab3146101565780632e0f262514610160578063313ce56714610168575b600080fd5b61014361026b565b6040519081526020015b60405180910390f35b61015e61038c565b005b610143600681565b6006610143565b61014361017d3660046112a1565b610515565b60005461018f9060ff1681565b604051901515815260200161014d565b610143610552565b6101e36040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b60405161014d9190611370565b6101f86105b3565b60405163ffffffff909116815260200161014d565b48610143565b61015e610638565b60005461018f90610100900460ff1681565b6101f8610832565b6101436102433660046112a1565b610893565b6101436102563660046113e3565b61098d565b610143610a69565b610143610b5c565b6000805460ff1615610304576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f47617350726963654f7261636c653a206f76657268656164282920697320646560448201527f707265636174656400000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038791906113fc565b905090565b3373deaddeaddeaddeaddeaddeaddeaddeaddead000114610455576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e2073657420697345636f746f6e6520666c6160648201527f6700000000000000000000000000000000000000000000000000000000000000608482015260a4016102fb565b60005460ff16156104e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a2045636f746f6e6520616c72656164792060448201527f616374697665000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60008054610100900460ff16156105355761052f82610bbd565b92915050565b60005460ff16156105495761052f82610bdc565b61052f82610c80565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610614573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611415565b3373deaddeaddeaddeaddeaddeaddeaddeaddead0001146106db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e20736574206973466a6f726420666c61670060648201526084016102fb565b60005460ff1661076d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f47617350726963654f7261636c653a20466a6f72642063616e206f6e6c79206260448201527f65206163746976617465642061667465722045636f746f6e650000000000000060648201526084016102fb565b600054610100900460ff1615610804576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f47617350726963654f7261636c653a20466a6f726420616c726561647920616360448201527f746976650000000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610614573d6000803e3d6000fd5b60008054610100900460ff16156108da57620f42406108c56108b484610dd4565b516108c090604461146a565b6110f1565b6108d0906010611482565b61052f91906114bf565b60006108e583611150565b60005490915060ff16156108f95792915050565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610958573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097c91906113fc565b610986908261146a565b9392505050565b60008054610100900460ff16610a25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f47617350726963654f7261636c653a206765744c314665655570706572426f7560448201527f6e64206f6e6c7920737570706f72747320466a6f72640000000000000000000060648201526084016102fb565b6000610a3283604461146a565b90506000610a4160ff836114bf565b610a4b908361146a565b610a5690601061146a565b9050610a61816111e0565b949350505050565b6000805460ff1615610afd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a207363616c61722829206973206465707260448201527f656361746564000000000000000000000000000000000000000000000000000060648201526084016102fb565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600061052f610bcb83610dd4565b51610bd790604461146a565b6111e0565b600080610be883611150565b90506000610bf4610552565b610bfc610832565b610c079060106114fa565b63ffffffff16610c179190611482565b90506000610c23610b5c565b610c2b6105b3565b63ffffffff16610c3b9190611482565b90506000610c49828461146a565b610c539085611482565b9050610c616006600a611646565b610c6c906010611482565b610c7690826114bf565b9695505050505050565b600080610c8c83611150565b9050600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1391906113fc565b610d1b610552565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9e91906113fc565b610da8908561146a565b610db29190611482565b610dbc9190611482565b9050610dca6006600a611646565b610a6190826114bf565b6060610f63565b818153600101919050565b600082840393505b838110156109865782810151828201511860001a1590930292600101610dee565b825b60208210610e5b578251610e26601f83610ddb565b52602092909201917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090910190602101610e11565b8115610986578251610e706001840383610ddb565b520160010192915050565b60006001830392505b6101078210610ebc57610eae8360ff16610ea960fd610ea98760081c60e00189610ddb565b610ddb565b935061010682039150610e84565b60078210610ee957610ee28360ff16610ea960078503610ea98760081c60e00189610ddb565b9050610986565b610a618360ff16610ea98560081c8560051b0187610ddb565b610f5b828203610f3f610f2f84600081518060001a8160011a60081b178160021a60101b17915050919050565b639e3779b90260131c611fff1690565b8060021b6040510182815160e01c1860e01b8151188152505050565b600101919050565b6180003860405139618000604051016020830180600d8551820103826002015b81811015611096576000805b50508051604051600082901a600183901a60081b1760029290921a60101b91909117639e3779b9810260111c617ffc16909101805160e081811c878603811890911b90911890915284019081830390848410610feb5750611026565b600184019350611fff8211611020578251600081901a600182901a60081b1760029190911a60101b1781036110205750611026565b50610f8f565b838310611034575050611096565b600183039250858311156110525761104f8787888603610e0f565b96505b611066600985016003850160038501610de6565b9150611073878284610e7b565b96505061108b8461108686848601610f02565b610f02565b915050809350610f83565b50506110a88383848851850103610e0f565b925050506040519150618000820180820391508183526020830160005b838110156110dd5782810151828201526020016110c5565b506000920191825250602001604052919050565b60008061110183620cc394611482565b61112b907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd763200611652565b905061113b6064620f42406116c6565b81121561052f576109866064620f42406116c6565b80516000908190815b818110156111d35784818151811061117357611173611782565b01602001517fff00000000000000000000000000000000000000000000000000000000000000166000036111b3576111ac60048461146a565b92506111c1565b6111be60108461146a565b92505b806111cb816117b1565b915050611159565b50610a618261044061146a565b6000806111ec836110f1565b905060006111f8610b5c565b6112006105b3565b63ffffffff166112109190611482565b611218610552565b611220610832565b61122b9060106114fa565b63ffffffff1661123b9190611482565b611245919061146a565b905061125360066002611482565b61125e90600a611646565b6112688284611482565b610a6191906114bf565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156112b357600080fd5b813567ffffffffffffffff808211156112cb57600080fd5b818401915084601f8301126112df57600080fd5b8135818111156112f1576112f1611272565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561133757611337611272565b8160405282815287602084870101111561135057600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b8181101561139d57858101830151858201604001528201611381565b818111156113af576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b6000602082840312156113f557600080fd5b5035919050565b60006020828403121561140e57600080fd5b5051919050565b60006020828403121561142757600080fd5b815163ffffffff8116811461098657600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561147d5761147d61143b565b500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156114ba576114ba61143b565b500290565b6000826114f5577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600063ffffffff8083168185168183048111821515161561151d5761151d61143b565b02949350505050565b600181815b8085111561157f57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156115655761156561143b565b8085161561157257918102915b93841c939080029061152b565b509250929050565b6000826115965750600161052f565b816115a35750600061052f565b81600181146115b957600281146115c3576115df565b600191505061052f565b60ff8411156115d4576115d461143b565b50506001821b61052f565b5060208310610133831016604e8410600b8410161715611602575081810a61052f565b61160c8383611526565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561163e5761163e61143b565b029392505050565b60006109868383611587565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0384138115161561168c5761168c61143b565b827f80000000000000000000000000000000000000000000000000000000000000000384128116156116c0576116c061143b565b50500190565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000841360008413858304851182821616156117075761170761143b565b7f800000000000000000000000000000000000000000000000000000000000000060008712868205881281841616156117425761174261143b565b6000871292508782058712848416161561175e5761175e61143b565b878505871281841616156117745761177461143b565b505050929093029392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036117e2576117e261143b565b506001019056fea164736f6c634300080f000a") // Update GasPricePriceOracle Proxy Parameters From fe398ca022a3dd7a983cdf06168dd3aaa47b83e7 Mon Sep 17 00:00:00 2001 From: Danyal Prout Date: Thu, 16 May 2024 16:19:46 +0100 Subject: [PATCH 14/14] Replace common.Hex2Bytes with common.FromHex --- op-e2e/fastlz_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/op-e2e/fastlz_test.go b/op-e2e/fastlz_test.go index ad901e3f461..c8b6d8b2e88 100644 --- a/op-e2e/fastlz_test.go +++ b/op-e2e/fastlz_test.go @@ -32,15 +32,15 @@ var ( seeds = [][]byte{ // https: //basescan.org/tx/0x5dadeb52979f29fc7a7494c43fdabc5be1d8ff404f3aafe93d729fa8e5d00769 - common.Hex2Bytes("0xb9047c02f904788221050883036ee48409c6c87383037f6f941195cf65f83b3a5768f3c496d3a05ad6412c64b78644364c5bb000b90404d123b4d80000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000038000000000000000000000000000000000f6476f90447748c19248ccaa31e6b8bfda4eb9d830f5f47df7f0998f7c2123d9e6137761b75d3184efb0f788e3b14516000000000000000000000000000000000000000000000000000044364c5bb000000000000000000000000000f38e53bd45c8225a7c94b513beadaa7afe5d222d0000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084d6574614d61736b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035697066733a2f2f516d656852577a743347745961776343347564745657557233454c587261436746434259416b66507331696f48610000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000cd0d83d9e840f8e27d5c2e365fd365ff1c05b2480000000000000000000000000000000000000000000000000000000000000ce40000000000000000000000000000000000000000000000000000000000000041e4480d358dbae20880960a0a464d63b06565a0c9f9b1b37aa94b522247b23ce149c81359bf4239d1a879eeb41047ec710c15f5c0f67453da59a383e6abd742971c00000000000000000000000000000000000000000000000000000000000000c001a0b57f0ff8516ea29cb26a44ac5055a5420847d1e16a8e7b03b70f0c02291ff2d5a00ad3771e5f39ccacfff0faa8c5d25ef7a1c179f79e66e828ffddcb994c8b512e"), + common.FromHex("0xb9047c02f904788221050883036ee48409c6c87383037f6f941195cf65f83b3a5768f3c496d3a05ad6412c64b78644364c5bb000b90404d123b4d80000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000038000000000000000000000000000000000f6476f90447748c19248ccaa31e6b8bfda4eb9d830f5f47df7f0998f7c2123d9e6137761b75d3184efb0f788e3b14516000000000000000000000000000000000000000000000000000044364c5bb000000000000000000000000000f38e53bd45c8225a7c94b513beadaa7afe5d222d0000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084d6574614d61736b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035697066733a2f2f516d656852577a743347745961776343347564745657557233454c587261436746434259416b66507331696f48610000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000cd0d83d9e840f8e27d5c2e365fd365ff1c05b2480000000000000000000000000000000000000000000000000000000000000ce40000000000000000000000000000000000000000000000000000000000000041e4480d358dbae20880960a0a464d63b06565a0c9f9b1b37aa94b522247b23ce149c81359bf4239d1a879eeb41047ec710c15f5c0f67453da59a383e6abd742971c00000000000000000000000000000000000000000000000000000000000000c001a0b57f0ff8516ea29cb26a44ac5055a5420847d1e16a8e7b03b70f0c02291ff2d5a00ad3771e5f39ccacfff0faa8c5d25ef7a1c179f79e66e828ffddcb994c8b512e"), // https://basescan.org/tx/0xfaada76a2dac09fc17f5a28d066aaabefc6d82ef6589b211ed8c9f766b070721 - common.Hex2Bytes("b87602f873822105528304320f8409cfe5c98252089480c67432656d59144ceff962e8faf8926599bcf888011dfe52d06b633f80c001a08632f069f837aea7a28bab0affee14dda116956bd5a850a355c045d25afedd17a0084b8f273efffe17ece527116053e5781a4915ff89ab9c379f1e62c25b697687"), + common.FromHex("b87602f873822105528304320f8409cfe5c98252089480c67432656d59144ceff962e8faf8926599bcf888011dfe52d06b633f80c001a08632f069f837aea7a28bab0affee14dda116956bd5a850a355c045d25afedd17a0084b8f273efffe17ece527116053e5781a4915ff89ab9c379f1e62c25b697687"), // https://basescan.org/tx/0x112864e9b971af6a1dac840018833c5a5a659acc187cfdaba919ad1da013678d - common.Hex2Bytes("b8b302f8b0822105308304320f8409cfe5c9827496944ed4e862860bed51a9570b96d89af5e1b0efefed80b844095ea7b3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba300000000000000000000000000000000000000000000015e10fb0973595fffffc001a02020e39f07917c1a852feb131c857e12478c7e88a20772b91a8bf5cee38c5aeea06055981727f9aaa3471c1af800555b35a77916c154be3f9d02ad1a63029455ab"), + common.FromHex("b8b302f8b0822105308304320f8409cfe5c9827496944ed4e862860bed51a9570b96d89af5e1b0efefed80b844095ea7b3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba300000000000000000000000000000000000000000000015e10fb0973595fffffc001a02020e39f07917c1a852feb131c857e12478c7e88a20772b91a8bf5cee38c5aeea06055981727f9aaa3471c1af800555b35a77916c154be3f9d02ad1a63029455ab"), // https://basescan.org/tx/0x6905051352691641888d0c427fb137c5b95afb5870d5169ff014eff1d0952195 - common.Hex2Bytes("b87202f86f8221058303dc6c8310db1f84068fa8d7838954409436af2ff952a7355c8045fcd5e88bc9f6c8257f7b8080c001a0b89e7ff3d7694109e73e7f4244e032581670313c36e48e485c9c94b853bd81d2a038ffaf8f10859ce21d1f7f7046c3d08027fb8aa15b69038f6102be97aaa1179a"), + common.FromHex("b87202f86f8221058303dc6c8310db1f84068fa8d7838954409436af2ff952a7355c8045fcd5e88bc9f6c8257f7b8080c001a0b89e7ff3d7694109e73e7f4244e032581670313c36e48e485c9c94b853bd81d2a038ffaf8f10859ce21d1f7f7046c3d08027fb8aa15b69038f6102be97aaa1179a"), // https://basescan.org/tx/0x6a38e9a26d7202a2268de69d2d47531c1a9829867579a483fb48d78e9e0b080d - common.Hex2Bytes("b9049b02f904978221058201618506fc23ac008506fc23ac008306ddd0943fc91a3afd70395cd496c647d5a6cc9d4b2b7fad80b904243593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006641d67b00000000000000000000000000000000000000000000000000000000000000030a000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000160000000000000000000000000088487bd8c3222d64d1d0b3fa7098dcf9d94d79e000000000000000000000000ffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000006669635d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fc91a3afd70395cd496c647d5a6cc9d4b2b7fad000000000000000000000000000000000000000000000000000000006641d78900000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000418661369ca026f92ff88347bd0e3625a7b5ed65071b366368c68ad7c55aed136c18659b34f9246e30a784227a53dd374fbd3d2124696808c678cd987c4e954a681b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000549e5c020c764dbfffff00000000000000000000000000000000000000000000000002e5a629c093a2b600000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002b088487bd8c3222d64d1d0b3fa7098dcf9d94d79e0027104200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000c001a014a3acef764ff6d3bb9bd81e420bfa94171a5734ab997dfbc9b41b653ce018a4a01ff5fccb01ef5c60ba3aef67d4e74f3f47312dd78bfbbff9e5090fbf2d3d62bb"), + common.FromHex("b9049b02f904978221058201618506fc23ac008506fc23ac008306ddd0943fc91a3afd70395cd496c647d5a6cc9d4b2b7fad80b904243593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006641d67b00000000000000000000000000000000000000000000000000000000000000030a000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000160000000000000000000000000088487bd8c3222d64d1d0b3fa7098dcf9d94d79e000000000000000000000000ffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000006669635d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fc91a3afd70395cd496c647d5a6cc9d4b2b7fad000000000000000000000000000000000000000000000000000000006641d78900000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000418661369ca026f92ff88347bd0e3625a7b5ed65071b366368c68ad7c55aed136c18659b34f9246e30a784227a53dd374fbd3d2124696808c678cd987c4e954a681b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000549e5c020c764dbfffff00000000000000000000000000000000000000000000000002e5a629c093a2b600000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002b088487bd8c3222d64d1d0b3fa7098dcf9d94d79e0027104200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000c001a014a3acef764ff6d3bb9bd81e420bfa94171a5734ab997dfbc9b41b653ce018a4a01ff5fccb01ef5c60ba3aef67d4e74f3f47312dd78bfbbff9e5090fbf2d3d62bb"), } )