Commit 97e4a25e authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub

Merge branch 'develop' into sc/ctb-failed-messages

parents 0716a085 ab8cf2ea
---
'@eth-optimism/contracts-periphery': patch
---
Minor fix to AttestationStation test
---
'@eth-optimism/common-ts': patch
---
Fixes a bug in BaseServiceV2 where options were not being parsed correctly when passed into the constructor rather than via environment variables or command line arguments
---
'@eth-optimism/contracts-bedrock': patch
---
Add echidna tests for portal
---
'@eth-optimism/contracts-periphery': patch
---
Add attestation contracts
---
'minimum-balance-agent': patch
---
Added basic balance monitoring
---
'@eth-optimism/contracts-periphery': patch
---
Update zeppelin deps in contracts periphery
---
'@eth-optimism/contracts-bedrock': patch
---
Adds a go package to generate fuzz inputs for the Bedrock contract tests.
---
'@eth-optimism/contracts-bedrock': patch
---
Add echidna tests for metering
---
'@eth-optimism/contracts-bedrock': patch
---
Add echidna tests for hashing
---
'@eth-optimism/common-ts': minor
'@eth-optimism/drippie-mon': patch
'@eth-optimism/fault-detector': patch
'@eth-optimism/replica-healthcheck': patch
---
Updates BaseServiceV2 so that options are secret by default. Services will have to explicitly mark options as "public" for those options to be logged and included in the metadata metric.
---
'@eth-optimism/contracts-periphery': patch
---
Add deploy script for attestations tation
---
'@eth-optimism/ci-builder': patch
'@eth-optimism/contracts-bedrock': patch
---
Add echidna tests for encoding
---
'@eth-optimism/contracts-periphery': patch
---
Make zeppelin deps in contracts periphery not get hoisted
---
'@eth-optimism/contracts-periphery': patch
---
Add some default options to optimist config
---
'@eth-optimism/sdk': patch
---
Don't pass 0 gasLimit for migrated withdrawals
---
'@eth-optimism/common-ts': minor
'@eth-optimism/drippie-mon': minor
'@eth-optimism/fault-detector': minor
'@eth-optimism/replica-healthcheck': minor
'@eth-optimism/data-transport-layer': patch
---
Refactors BaseServiceV2 slightly, merges standard options with regular options
---
'@eth-optimism/sdk': minor
'@eth-optimism/contracts': patch
---
Removes support for Kovan
---
'@eth-optimism/ci-builder': patch
'@eth-optimism/contracts-bedrock': patch
---
Add echidna tests for Burn
---
'@eth-optimism/common-ts': patch
---
Adds a function for waiting for ethers providers
---
'@eth-optimism/contracts-periphery': patch
---
Add authors to optimist contracts
---
'@eth-optimism/common-ts': patch
---
Make logLevel a default option of BaseServiceV2
---
'@eth-optimism/contracts-bedrock': patch
---
Add tests for the `Bytes` library
---
'@eth-optimism/fault-detector': patch
---
Fault detector will now wait for providers to be connected
---
'@eth-optimism/contracts-periphery': patch
---
Make deploy scripts a little safer
---
'@eth-optimism/contracts-periphery': patch
---
Add test coverage script to contracts periphery
---
'@eth-optimism/contracts-periphery': patch
---
Add deployment scripts for optimist
---
'@eth-optimism/contracts-bedrock': patch
---
Make lint check and fix scripts match
---
'@eth-optimism/common-ts': patch
---
Adds new standard options to disable parsing variables from environment and command line.
---
'minimum-balance-agent': patch
---
Created the Balance Monitoring package
---
'@eth-optimism/contracts-periphery': patch
---
Add optimist contract
...@@ -18,6 +18,7 @@ jobs: ...@@ -18,6 +18,7 @@ jobs:
data-transport-layer: ${{ steps.packages.outputs.data-transport-layer }} data-transport-layer: ${{ steps.packages.outputs.data-transport-layer }}
contracts: ${{ steps.packages.outputs.contracts }} contracts: ${{ steps.packages.outputs.contracts }}
contracts-bedrock: ${{ steps.packages.outputs.contracts-bedrock }} contracts-bedrock: ${{ steps.packages.outputs.contracts-bedrock }}
balance-monitor: ${{ steps.packages.outputs.balance-monitor }}
gas-oracle: ${{ steps.packages.outputs.gas-oracle }} gas-oracle: ${{ steps.packages.outputs.gas-oracle }}
replica-healthcheck: ${{ steps.packages.outputs.replica-healthcheck }} replica-healthcheck: ${{ steps.packages.outputs.replica-healthcheck }}
proxyd: ${{ steps.packages.outputs.proxyd }} proxyd: ${{ steps.packages.outputs.proxyd }}
......
...@@ -29,11 +29,11 @@ ...@@ -29,11 +29,11 @@
}, },
"devDependencies": { "devDependencies": {
"@babel/eslint-parser": "^7.5.4", "@babel/eslint-parser": "^7.5.4",
"@eth-optimism/contracts": "^0.5.39", "@eth-optimism/contracts": "^0.5.40",
"@eth-optimism/contracts-bedrock": "0.11.0", "@eth-optimism/contracts-bedrock": "0.11.1",
"@eth-optimism/contracts-periphery": "^1.0.4", "@eth-optimism/contracts-periphery": "^1.0.5",
"@eth-optimism/core-utils": "0.12.0", "@eth-optimism/core-utils": "0.12.0",
"@eth-optimism/sdk": "1.8.0", "@eth-optimism/sdk": "1.9.0",
"@ethersproject/abstract-provider": "^5.7.0", "@ethersproject/abstract-provider": "^5.7.0",
"@ethersproject/providers": "^5.7.0", "@ethersproject/providers": "^5.7.0",
"@ethersproject/transactions": "^5.7.0", "@ethersproject/transactions": "^5.7.0",
......
...@@ -30,8 +30,8 @@ var ( ...@@ -30,8 +30,8 @@ var (
// GasPriceOracleMetaData contains all meta data concerning the GasPriceOracle contract. // GasPriceOracleMetaData contains all meta data concerning the GasPriceOracle contract.
var GasPriceOracleMetaData = &bind.MetaData{ var GasPriceOracleMetaData = &bind.MetaData{
ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"baseFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"getL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"getL1GasUsed\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1BaseFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"overhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"scalar\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"DECIMALS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"baseFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"getL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"getL1GasUsed\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1BaseFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"overhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"scalar\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]",
Bin: "0x60e060405234801561001057600080fd5b506000608081905260a052600160c05260805160a05160c051610a0161004f60003960006102c1015260006102980152600061026f0152610a016000f3fe608060405234801561001057600080fd5b50600436106100a35760003560e01c806354fd4d5011610076578063de26c4a11161005b578063de26c4a114610101578063f45e65d814610114578063fe173b97146100fb57600080fd5b806354fd4d50146100e65780636ef25c3a146100fb57600080fd5b80630c18c162146100a8578063313ce567146100c357806349948e0e146100cb578063519b4bd3146100de575b600080fd5b6100b061011c565b6040519081526020015b60405180910390f35b6100b0600681565b6100b06100d9366004610587565b6101a6565b6100b0610207565b6100ee610268565b6040516100ba9190610686565b486100b0565b6100b061010f366004610587565b61030b565b6100b06103ba565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa15801561017d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101a191906106d7565b905090565b6000806101b28361030b565b905060006101be610207565b6101c8908361071f565b905060006101d86006600a61087e565b905060006101e46103ba565b6101ee908461071f565b905060006101fc83836108c0565b979650505050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa15801561017d573d6000803e3d6000fd5b60606102937f000000000000000000000000000000000000000000000000000000000000000061041b565b6102bc7f000000000000000000000000000000000000000000000000000000000000000061041b565b6102e57f000000000000000000000000000000000000000000000000000000000000000061041b565b6040516020016102f7939291906108d4565b604051602081830303815290604052905090565b80516000908190815b8181101561038e5784818151811061032e5761032e61094a565b01602001517fff000000000000000000000000000000000000000000000000000000000000001660000361036e57610367600484610979565b925061037c565b610379601084610979565b92505b8061038681610991565b915050610314565b50600061039961011c565b6103a39084610979565b90506103b181610440610979565b95945050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa15801561017d573d6000803e3d6000fd5b60608160000361045e57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115610488578061047281610991565b91506104819050600a836108c0565b9150610462565b60008167ffffffffffffffff8111156104a3576104a3610558565b6040519080825280601f01601f1916602001820160405280156104cd576020820181803683370190505b5090505b8415610550576104e26001836109c9565b91506104ef600a866109e0565b6104fa906030610979565b60f81b81838151811061050f5761050f61094a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610549600a866108c0565b94506104d1565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561059957600080fd5b813567ffffffffffffffff808211156105b157600080fd5b818401915084601f8301126105c557600080fd5b8135818111156105d7576105d7610558565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561061d5761061d610558565b8160405282815287602084870101111561063657600080fd5b826020860160208301376000928101602001929092525095945050505050565b60005b83811015610671578181015183820152602001610659565b83811115610680576000848401525b50505050565b60208152600082518060208401526106a5816040850160208701610656565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6000602082840312156106e957600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610757576107576106f0565b500290565b600181815b808511156107b557817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561079b5761079b6106f0565b808516156107a857918102915b93841c9390800290610761565b509250929050565b6000826107cc57506001610878565b816107d957506000610878565b81600181146107ef57600281146107f957610815565b6001915050610878565b60ff84111561080a5761080a6106f0565b50506001821b610878565b5060208310610133831016604e8410600b8410161715610838575081810a610878565b610842838361075c565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610874576108746106f0565b0290505b92915050565b600061088a83836107bd565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826108cf576108cf610891565b500490565b600084516108e6818460208901610656565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610922816001850160208a01610656565b6001920191820152835161093d816002840160208801610656565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000821982111561098c5761098c6106f0565b500190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036109c2576109c26106f0565b5060010190565b6000828210156109db576109db6106f0565b500390565b6000826109ef576109ef610891565b50069056fea164736f6c634300080f000a", Bin: "0x60e060405234801561001057600080fd5b506000608081905260a052600160c05260805160a05160c051610a2361004f60003960006102e3015260006102ba015260006102910152610a236000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c806354fd4d5011610076578063de26c4a11161005b578063de26c4a114610123578063f45e65d814610136578063fe173b971461011d57600080fd5b806354fd4d50146101085780636ef25c3a1461011d57600080fd5b8063313ce567116100a7578063313ce567146100e657806349948e0e146100ed578063519b4bd31461010057600080fd5b80630c18c162146100c35780632e0f2625146100de575b600080fd5b6100cb61013e565b6040519081526020015b60405180910390f35b6100cb600681565b60066100cb565b6100cb6100fb3660046105a9565b6101c8565b6100cb610229565b61011061028a565b6040516100d591906106a8565b486100cb565b6100cb6101313660046105a9565b61032d565b6100cb6103dc565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa15801561019f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c391906106f9565b905090565b6000806101d48361032d565b905060006101e0610229565b6101ea9083610741565b905060006101fa6006600a6108a0565b905060006102066103dc565b6102109084610741565b9050600061021e83836108e2565b979650505050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa15801561019f573d6000803e3d6000fd5b60606102b57f000000000000000000000000000000000000000000000000000000000000000061043d565b6102de7f000000000000000000000000000000000000000000000000000000000000000061043d565b6103077f000000000000000000000000000000000000000000000000000000000000000061043d565b604051602001610319939291906108f6565b604051602081830303815290604052905090565b80516000908190815b818110156103b0578481815181106103505761035061096c565b01602001517fff00000000000000000000000000000000000000000000000000000000000000166000036103905761038960048461099b565b925061039e565b61039b60108461099b565b92505b806103a8816109b3565b915050610336565b5060006103bb61013e565b6103c5908461099b565b90506103d38161044061099b565b95945050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa15801561019f573d6000803e3d6000fd5b60608160000361048057505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156104aa5780610494816109b3565b91506104a39050600a836108e2565b9150610484565b60008167ffffffffffffffff8111156104c5576104c561057a565b6040519080825280601f01601f1916602001820160405280156104ef576020820181803683370190505b5090505b8415610572576105046001836109eb565b9150610511600a86610a02565b61051c90603061099b565b60f81b8183815181106105315761053161096c565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061056b600a866108e2565b94506104f3565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156105bb57600080fd5b813567ffffffffffffffff808211156105d357600080fd5b818401915084601f8301126105e757600080fd5b8135818111156105f9576105f961057a565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561063f5761063f61057a565b8160405282815287602084870101111561065857600080fd5b826020860160208301376000928101602001929092525095945050505050565b60005b8381101561069357818101518382015260200161067b565b838111156106a2576000848401525b50505050565b60208152600082518060208401526106c7816040850160208701610678565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60006020828403121561070b57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561077957610779610712565b500290565b600181815b808511156107d757817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156107bd576107bd610712565b808516156107ca57918102915b93841c9390800290610783565b509250929050565b6000826107ee5750600161089a565b816107fb5750600061089a565b8160018114610811576002811461081b57610837565b600191505061089a565b60ff84111561082c5761082c610712565b50506001821b61089a565b5060208310610133831016604e8410600b841016171561085a575081810a61089a565b610864838361077e565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561089657610896610712565b0290505b92915050565b60006108ac83836107df565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826108f1576108f16108b3565b500490565b60008451610908818460208901610678565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610944816001850160208a01610678565b6001920191820152835161095f816002840160208801610678565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082198211156109ae576109ae610712565b500190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036109e4576109e4610712565b5060010190565b6000828210156109fd576109fd610712565b500390565b600082610a1157610a116108b3565b50069056fea164736f6c634300080f000a",
} }
// GasPriceOracleABI is the input ABI used to generate the binding from. // GasPriceOracleABI is the input ABI used to generate the binding from.
...@@ -201,6 +201,37 @@ func (_GasPriceOracle *GasPriceOracleTransactorRaw) Transact(opts *bind.Transact ...@@ -201,6 +201,37 @@ func (_GasPriceOracle *GasPriceOracleTransactorRaw) Transact(opts *bind.Transact
return _GasPriceOracle.Contract.contract.Transact(opts, method, params...) return _GasPriceOracle.Contract.contract.Transact(opts, method, params...)
} }
// DECIMALS is a free data retrieval call binding the contract method 0x2e0f2625.
//
// Solidity: function DECIMALS() view returns(uint256)
func (_GasPriceOracle *GasPriceOracleCaller) DECIMALS(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _GasPriceOracle.contract.Call(opts, &out, "DECIMALS")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// DECIMALS is a free data retrieval call binding the contract method 0x2e0f2625.
//
// Solidity: function DECIMALS() view returns(uint256)
func (_GasPriceOracle *GasPriceOracleSession) DECIMALS() (*big.Int, error) {
return _GasPriceOracle.Contract.DECIMALS(&_GasPriceOracle.CallOpts)
}
// DECIMALS is a free data retrieval call binding the contract method 0x2e0f2625.
//
// Solidity: function DECIMALS() view returns(uint256)
func (_GasPriceOracle *GasPriceOracleCallerSession) DECIMALS() (*big.Int, error) {
return _GasPriceOracle.Contract.DECIMALS(&_GasPriceOracle.CallOpts)
}
// BaseFee is a free data retrieval call binding the contract method 0x6ef25c3a. // BaseFee is a free data retrieval call binding the contract method 0x6ef25c3a.
// //
// Solidity: function baseFee() view returns(uint256) // Solidity: function baseFee() view returns(uint256)
...@@ -234,7 +265,7 @@ func (_GasPriceOracle *GasPriceOracleCallerSession) BaseFee() (*big.Int, error) ...@@ -234,7 +265,7 @@ func (_GasPriceOracle *GasPriceOracleCallerSession) BaseFee() (*big.Int, error)
// Decimals is a free data retrieval call binding the contract method 0x313ce567. // Decimals is a free data retrieval call binding the contract method 0x313ce567.
// //
// Solidity: function decimals() view returns(uint256) // Solidity: function decimals() pure returns(uint256)
func (_GasPriceOracle *GasPriceOracleCaller) Decimals(opts *bind.CallOpts) (*big.Int, error) { func (_GasPriceOracle *GasPriceOracleCaller) Decimals(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{} var out []interface{}
err := _GasPriceOracle.contract.Call(opts, &out, "decimals") err := _GasPriceOracle.contract.Call(opts, &out, "decimals")
...@@ -251,14 +282,14 @@ func (_GasPriceOracle *GasPriceOracleCaller) Decimals(opts *bind.CallOpts) (*big ...@@ -251,14 +282,14 @@ func (_GasPriceOracle *GasPriceOracleCaller) Decimals(opts *bind.CallOpts) (*big
// Decimals is a free data retrieval call binding the contract method 0x313ce567. // Decimals is a free data retrieval call binding the contract method 0x313ce567.
// //
// Solidity: function decimals() view returns(uint256) // Solidity: function decimals() pure returns(uint256)
func (_GasPriceOracle *GasPriceOracleSession) Decimals() (*big.Int, error) { func (_GasPriceOracle *GasPriceOracleSession) Decimals() (*big.Int, error) {
return _GasPriceOracle.Contract.Decimals(&_GasPriceOracle.CallOpts) return _GasPriceOracle.Contract.Decimals(&_GasPriceOracle.CallOpts)
} }
// Decimals is a free data retrieval call binding the contract method 0x313ce567. // Decimals is a free data retrieval call binding the contract method 0x313ce567.
// //
// Solidity: function decimals() view returns(uint256) // Solidity: function decimals() pure returns(uint256)
func (_GasPriceOracle *GasPriceOracleCallerSession) Decimals() (*big.Int, error) { func (_GasPriceOracle *GasPriceOracleCallerSession) Decimals() (*big.Int, error) {
return _GasPriceOracle.Contract.Decimals(&_GasPriceOracle.CallOpts) return _GasPriceOracle.Contract.Decimals(&_GasPriceOracle.CallOpts)
} }
......
...@@ -9,11 +9,11 @@ import ( ...@@ -9,11 +9,11 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const GasPriceOracleStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"spacer_0_0_20\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"},{\"astId\":1001,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"spacer_1_0_32\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_uint256\"},{\"astId\":1002,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"spacer_2_0_32\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_uint256\"},{\"astId\":1003,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"spacer_3_0_32\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_uint256\"},{\"astId\":1004,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"spacer_4_0_32\",\"offset\":0,\"slot\":\"4\",\"type\":\"t_uint256\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"}}}" const GasPriceOracleStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"spacer_0_0_20\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"},{\"astId\":1001,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"spacer_1_0_32\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_uint256\"},{\"astId\":1002,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"spacer_2_0_32\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_uint256\"},{\"astId\":1003,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"spacer_3_0_32\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_uint256\"},{\"astId\":1004,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"spacer_4_0_32\",\"offset\":0,\"slot\":\"4\",\"type\":\"t_uint256\"},{\"astId\":1005,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"spacer_5_0_32\",\"offset\":0,\"slot\":\"5\",\"type\":\"t_uint256\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"}}}"
var GasPriceOracleStorageLayout = new(solc.StorageLayout) var GasPriceOracleStorageLayout = new(solc.StorageLayout)
var GasPriceOracleDeployedBin = "0x608060405234801561001057600080fd5b50600436106100a35760003560e01c806354fd4d5011610076578063de26c4a11161005b578063de26c4a114610101578063f45e65d814610114578063fe173b97146100fb57600080fd5b806354fd4d50146100e65780636ef25c3a146100fb57600080fd5b80630c18c162146100a8578063313ce567146100c357806349948e0e146100cb578063519b4bd3146100de575b600080fd5b6100b061011c565b6040519081526020015b60405180910390f35b6100b0600681565b6100b06100d9366004610587565b6101a6565b6100b0610207565b6100ee610268565b6040516100ba9190610686565b486100b0565b6100b061010f366004610587565b61030b565b6100b06103ba565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa15801561017d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101a191906106d7565b905090565b6000806101b28361030b565b905060006101be610207565b6101c8908361071f565b905060006101d86006600a61087e565b905060006101e46103ba565b6101ee908461071f565b905060006101fc83836108c0565b979650505050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa15801561017d573d6000803e3d6000fd5b60606102937f000000000000000000000000000000000000000000000000000000000000000061041b565b6102bc7f000000000000000000000000000000000000000000000000000000000000000061041b565b6102e57f000000000000000000000000000000000000000000000000000000000000000061041b565b6040516020016102f7939291906108d4565b604051602081830303815290604052905090565b80516000908190815b8181101561038e5784818151811061032e5761032e61094a565b01602001517fff000000000000000000000000000000000000000000000000000000000000001660000361036e57610367600484610979565b925061037c565b610379601084610979565b92505b8061038681610991565b915050610314565b50600061039961011c565b6103a39084610979565b90506103b181610440610979565b95945050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa15801561017d573d6000803e3d6000fd5b60608160000361045e57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115610488578061047281610991565b91506104819050600a836108c0565b9150610462565b60008167ffffffffffffffff8111156104a3576104a3610558565b6040519080825280601f01601f1916602001820160405280156104cd576020820181803683370190505b5090505b8415610550576104e26001836109c9565b91506104ef600a866109e0565b6104fa906030610979565b60f81b81838151811061050f5761050f61094a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610549600a866108c0565b94506104d1565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561059957600080fd5b813567ffffffffffffffff808211156105b157600080fd5b818401915084601f8301126105c557600080fd5b8135818111156105d7576105d7610558565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561061d5761061d610558565b8160405282815287602084870101111561063657600080fd5b826020860160208301376000928101602001929092525095945050505050565b60005b83811015610671578181015183820152602001610659565b83811115610680576000848401525b50505050565b60208152600082518060208401526106a5816040850160208701610656565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6000602082840312156106e957600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610757576107576106f0565b500290565b600181815b808511156107b557817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561079b5761079b6106f0565b808516156107a857918102915b93841c9390800290610761565b509250929050565b6000826107cc57506001610878565b816107d957506000610878565b81600181146107ef57600281146107f957610815565b6001915050610878565b60ff84111561080a5761080a6106f0565b50506001821b610878565b5060208310610133831016604e8410600b8410161715610838575081810a610878565b610842838361075c565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610874576108746106f0565b0290505b92915050565b600061088a83836107bd565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826108cf576108cf610891565b500490565b600084516108e6818460208901610656565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610922816001850160208a01610656565b6001920191820152835161093d816002840160208801610656565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000821982111561098c5761098c6106f0565b500190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036109c2576109c26106f0565b5060010190565b6000828210156109db576109db6106f0565b500390565b6000826109ef576109ef610891565b50069056fea164736f6c634300080f000a" var GasPriceOracleDeployedBin = "0x608060405234801561001057600080fd5b50600436106100be5760003560e01c806354fd4d5011610076578063de26c4a11161005b578063de26c4a114610123578063f45e65d814610136578063fe173b971461011d57600080fd5b806354fd4d50146101085780636ef25c3a1461011d57600080fd5b8063313ce567116100a7578063313ce567146100e657806349948e0e146100ed578063519b4bd31461010057600080fd5b80630c18c162146100c35780632e0f2625146100de575b600080fd5b6100cb61013e565b6040519081526020015b60405180910390f35b6100cb600681565b60066100cb565b6100cb6100fb3660046105a9565b6101c8565b6100cb610229565b61011061028a565b6040516100d591906106a8565b486100cb565b6100cb6101313660046105a9565b61032d565b6100cb6103dc565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa15801561019f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c391906106f9565b905090565b6000806101d48361032d565b905060006101e0610229565b6101ea9083610741565b905060006101fa6006600a6108a0565b905060006102066103dc565b6102109084610741565b9050600061021e83836108e2565b979650505050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa15801561019f573d6000803e3d6000fd5b60606102b57f000000000000000000000000000000000000000000000000000000000000000061043d565b6102de7f000000000000000000000000000000000000000000000000000000000000000061043d565b6103077f000000000000000000000000000000000000000000000000000000000000000061043d565b604051602001610319939291906108f6565b604051602081830303815290604052905090565b80516000908190815b818110156103b0578481815181106103505761035061096c565b01602001517fff00000000000000000000000000000000000000000000000000000000000000166000036103905761038960048461099b565b925061039e565b61039b60108461099b565b92505b806103a8816109b3565b915050610336565b5060006103bb61013e565b6103c5908461099b565b90506103d38161044061099b565b95945050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa15801561019f573d6000803e3d6000fd5b60608160000361048057505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156104aa5780610494816109b3565b91506104a39050600a836108e2565b9150610484565b60008167ffffffffffffffff8111156104c5576104c561057a565b6040519080825280601f01601f1916602001820160405280156104ef576020820181803683370190505b5090505b8415610572576105046001836109eb565b9150610511600a86610a02565b61051c90603061099b565b60f81b8183815181106105315761053161096c565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061056b600a866108e2565b94506104f3565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156105bb57600080fd5b813567ffffffffffffffff808211156105d357600080fd5b818401915084601f8301126105e757600080fd5b8135818111156105f9576105f961057a565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561063f5761063f61057a565b8160405282815287602084870101111561065857600080fd5b826020860160208301376000928101602001929092525095945050505050565b60005b8381101561069357818101518382015260200161067b565b838111156106a2576000848401525b50505050565b60208152600082518060208401526106c7816040850160208701610678565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60006020828403121561070b57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561077957610779610712565b500290565b600181815b808511156107d757817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156107bd576107bd610712565b808516156107ca57918102915b93841c9390800290610783565b509250929050565b6000826107ee5750600161089a565b816107fb5750600061089a565b8160018114610811576002811461081b57610837565b600191505061089a565b60ff84111561082c5761082c610712565b50506001821b61089a565b5060208310610133831016604e8410600b841016171561085a575081810a61089a565b610864838361077e565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561089657610896610712565b0290505b92915050565b60006108ac83836107df565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826108f1576108f16108b3565b500490565b60008451610908818460208901610678565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610944816001850160208a01610678565b6001920191820152835161095f816002840160208801610678565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082198211156109ae576109ae610712565b500190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036109e4576109e4610712565b5060010190565b6000828210156109fd576109fd610712565b500390565b600082610a1157610a116108b3565b50069056fea164736f6c634300080f000a"
func init() { func init() {
if err := json.Unmarshal([]byte(GasPriceOracleStorageLayoutJSON), GasPriceOracleStorageLayout); err != nil { if err := json.Unmarshal([]byte(GasPriceOracleStorageLayoutJSON), GasPriceOracleStorageLayout); err != nil {
......
...@@ -16,6 +16,9 @@ import ( ...@@ -16,6 +16,9 @@ import (
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
) )
// validateReceipts validates that the receipt contents are valid.
// Warning: contractAddress is not verified, since it is a more expensive operation for data we do not use.
// See go-ethereum/crypto.CreateAddress to verify contract deployment address data based on sender and tx nonce.
func validateReceipts(block eth.BlockID, receiptHash common.Hash, txHashes []common.Hash, receipts []*types.Receipt) error { func validateReceipts(block eth.BlockID, receiptHash common.Hash, txHashes []common.Hash, receipts []*types.Receipt) error {
if len(receipts) != len(txHashes) { if len(receipts) != len(txHashes) {
return fmt.Errorf("got %d receipts but expected %d", len(receipts), len(txHashes)) return fmt.Errorf("got %d receipts but expected %d", len(receipts), len(txHashes))
...@@ -28,6 +31,7 @@ func validateReceipts(block eth.BlockID, receiptHash common.Hash, txHashes []com ...@@ -28,6 +31,7 @@ func validateReceipts(block eth.BlockID, receiptHash common.Hash, txHashes []com
// We don't trust the RPC to provide consistent cached receipt info that we use for critical rollup derivation work. // We don't trust the RPC to provide consistent cached receipt info that we use for critical rollup derivation work.
// Let's check everything quickly. // Let's check everything quickly.
logIndex := uint(0) logIndex := uint(0)
cumulativeGas := uint64(0)
for i, r := range receipts { for i, r := range receipts {
if r == nil { // on reorgs or other cases the receipts may disappear before they can be retrieved. if r == nil { // on reorgs or other cases the receipts may disappear before they can be retrieved.
return fmt.Errorf("receipt of tx %d returns nil on retrieval", i) return fmt.Errorf("receipt of tx %d returns nil on retrieval", i)
...@@ -44,6 +48,9 @@ func validateReceipts(block eth.BlockID, receiptHash common.Hash, txHashes []com ...@@ -44,6 +48,9 @@ func validateReceipts(block eth.BlockID, receiptHash common.Hash, txHashes []com
if r.BlockHash != block.Hash { if r.BlockHash != block.Hash {
return fmt.Errorf("receipt %d has unexpected block hash %s, expected %s", i, r.BlockHash, block.Hash) return fmt.Errorf("receipt %d has unexpected block hash %s, expected %s", i, r.BlockHash, block.Hash)
} }
if expected := r.CumulativeGasUsed - cumulativeGas; r.GasUsed != expected {
return fmt.Errorf("receipt %d has invalid gas used metadata: %d, expected %d", i, r.GasUsed, expected)
}
for j, log := range r.Logs { for j, log := range r.Logs {
if log.Index != logIndex { if log.Index != logIndex {
return fmt.Errorf("log %d (%d of tx %d) has unexpected log index %d", logIndex, j, i, log.Index) return fmt.Errorf("log %d (%d of tx %d) has unexpected log index %d", logIndex, j, i, log.Index)
...@@ -65,10 +72,10 @@ func validateReceipts(block eth.BlockID, receiptHash common.Hash, txHashes []com ...@@ -65,10 +72,10 @@ func validateReceipts(block eth.BlockID, receiptHash common.Hash, txHashes []com
} }
logIndex++ logIndex++
} }
cumulativeGas = r.CumulativeGasUsed
// Note: 3 non-consensus L1 receipt fields are ignored: // Note: 3 non-consensus L1 receipt fields are ignored:
// PostState - not part of L1 ethereum anymore since EIP 658 (part of Byzantium) // PostState - not part of L1 ethereum anymore since EIP 658 (part of Byzantium)
// ContractAddress - we do not care about contract deployments // ContractAddress - we do not care about contract deployments
// GasUsed - we do not care about L1 gas usage of txs
// And Optimism L1 fee meta-data in the receipt is ignored as well // And Optimism L1 fee meta-data in the receipt is ignored as well
} }
...@@ -250,7 +257,7 @@ const ( ...@@ -250,7 +257,7 @@ const (
func AvailableReceiptsFetchingMethods(kind RPCProviderKind) ReceiptsFetchingMethod { func AvailableReceiptsFetchingMethods(kind RPCProviderKind) ReceiptsFetchingMethod {
switch kind { switch kind {
case RPCKindAlchemy: case RPCKindAlchemy:
return AlchemyGetTransactionReceipts | EthGetTransactionReceiptBatch return AlchemyGetTransactionReceipts | EthGetBlockReceipts | EthGetTransactionReceiptBatch
case RPCKindQuickNode: case RPCKindQuickNode:
return DebugGetRawReceipts | EthGetBlockReceipts | EthGetTransactionReceiptBatch return DebugGetRawReceipts | EthGetBlockReceipts | EthGetTransactionReceiptBatch
case RPCKindInfura: case RPCKindInfura:
...@@ -287,9 +294,6 @@ func PickBestReceiptsFetchingMethod(kind RPCProviderKind, available ReceiptsFetc ...@@ -287,9 +294,6 @@ func PickBestReceiptsFetchingMethod(kind RPCProviderKind, available ReceiptsFetc
if available&EthGetBlockReceipts != 0 && txCount > 500/15 { if available&EthGetBlockReceipts != 0 && txCount > 500/15 {
return EthGetBlockReceipts return EthGetBlockReceipts
} }
if available&ParityGetBlockReceipts != 0 && txCount > 500/15 {
return ParityGetBlockReceipts
}
return EthGetTransactionReceiptBatch return EthGetTransactionReceiptBatch
} else if kind == RPCKindQuickNode { } else if kind == RPCKindQuickNode {
if available&DebugGetRawReceipts != 0 { if available&DebugGetRawReceipts != 0 {
...@@ -298,18 +302,20 @@ func PickBestReceiptsFetchingMethod(kind RPCProviderKind, available ReceiptsFetc ...@@ -298,18 +302,20 @@ func PickBestReceiptsFetchingMethod(kind RPCProviderKind, available ReceiptsFetc
if available&EthGetBlockReceipts != 0 && txCount > 59/2 { if available&EthGetBlockReceipts != 0 && txCount > 59/2 {
return EthGetBlockReceipts return EthGetBlockReceipts
} }
if available&ParityGetBlockReceipts != 0 && txCount > 59/2 {
return ParityGetBlockReceipts
}
return EthGetTransactionReceiptBatch return EthGetTransactionReceiptBatch
} }
// otherwise just find the first available method // in order of preference (based on cost): check available methods
x := ReceiptsFetchingMethod(1) if available&AlchemyGetTransactionReceipts != 0 {
for x != 0 { return AlchemyGetTransactionReceipts
if available&x != 0 { }
return x if available&DebugGetRawReceipts != 0 {
} return DebugGetRawReceipts
x <<= 1 }
if available&EthGetBlockReceipts != 0 {
return EthGetBlockReceipts
}
if available&ParityGetBlockReceipts != 0 {
return ParityGetBlockReceipts
} }
// otherwise fall back on per-tx fetching // otherwise fall back on per-tx fetching
return EthGetTransactionReceiptBatch return EthGetTransactionReceiptBatch
...@@ -415,6 +421,7 @@ func (job *receiptsFetchingJob) runAltMethod(ctx context.Context, m ReceiptsFetc ...@@ -415,6 +421,7 @@ func (job *receiptsFetchingJob) runAltMethod(ctx context.Context, m ReceiptsFetc
if len(rawReceipts) == len(job.txHashes) { if len(rawReceipts) == len(job.txHashes) {
result = make([]*types.Receipt, len(rawReceipts)) result = make([]*types.Receipt, len(rawReceipts))
totalIndex := uint(0) totalIndex := uint(0)
prevCumulativeGasUsed := uint64(0)
for i, r := range rawReceipts { for i, r := range rawReceipts {
var x types.Receipt var x types.Receipt
_ = x.UnmarshalBinary(r) // safe to ignore, we verify receipts against the receipts hash later _ = x.UnmarshalBinary(r) // safe to ignore, we verify receipts against the receipts hash later
...@@ -422,6 +429,9 @@ func (job *receiptsFetchingJob) runAltMethod(ctx context.Context, m ReceiptsFetc ...@@ -422,6 +429,9 @@ func (job *receiptsFetchingJob) runAltMethod(ctx context.Context, m ReceiptsFetc
x.BlockHash = job.block.Hash x.BlockHash = job.block.Hash
x.BlockNumber = new(big.Int).SetUint64(job.block.Number) x.BlockNumber = new(big.Int).SetUint64(job.block.Number)
x.TransactionIndex = uint(i) x.TransactionIndex = uint(i)
x.GasUsed = x.CumulativeGasUsed - prevCumulativeGasUsed
// contract address meta-data is not computed.
prevCumulativeGasUsed = x.CumulativeGasUsed
for _, l := range x.Logs { for _, l := range x.Logs {
l.BlockNumber = job.block.Number l.BlockNumber = job.block.Number
l.TxHash = x.TxHash l.TxHash = x.TxHash
......
package sources
import (
"context"
"encoding/json"
"fmt"
"math/rand"
"testing"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"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/log"
"github.com/ethereum/go-ethereum/rpc"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
)
type ethBackend struct {
*mock.Mock
}
func (b *ethBackend) GetBlockByHash(id common.Hash, fullTxs bool) (*rpcBlock, error) {
out := b.Mock.MethodCalled("eth_getBlockByHash", id, fullTxs)
return out[0].(*rpcBlock), nil
}
func (b *ethBackend) GetTransactionReceipt(txHash common.Hash) (*types.Receipt, error) {
out := b.Mock.MethodCalled("eth_getTransactionReceipt", txHash)
return out[0].(*types.Receipt), *out[1].(*error)
}
func (b *ethBackend) GetBlockReceipts(id string) ([]*types.Receipt, error) {
out := b.Mock.MethodCalled("eth_getBlockReceipts", id)
return out[0].([]*types.Receipt), *out[1].(*error)
}
type alchemyBackend struct {
*mock.Mock
}
func (b *alchemyBackend) GetTransactionReceipts(p blockHashParameter) (*receiptsWrapper, error) {
out := b.Mock.MethodCalled("alchemy_getTransactionReceipts", p.BlockHash.String())
return &receiptsWrapper{Receipts: out[0].([]*types.Receipt)}, *out[1].(*error)
}
type debugBackend struct {
*mock.Mock
}
func (b *debugBackend) GetRawReceipts(id string) ([]hexutil.Bytes, error) {
out := b.Mock.MethodCalled("debug_getRawReceipts", id)
return out[0].([]hexutil.Bytes), *out[1].(*error)
}
type parityBackend struct {
*mock.Mock
}
func (b *parityBackend) GetBlockReceipts(id string) ([]*types.Receipt, error) {
out := b.Mock.MethodCalled("parity_getBlockReceipts", id)
return out[0].([]*types.Receipt), *out[1].(*error)
}
type ReceiptsRequest struct {
method ReceiptsFetchingMethod
result []*types.Receipt
err error
}
type methodNotFoundError struct{ method string }
func (e *methodNotFoundError) ErrorCode() int { return -32601 }
func (e *methodNotFoundError) Error() string {
return fmt.Sprintf("the method %s does not exist/is not available", e.method)
}
// ReceiptsTestCase runs through a series of receipt fetching RPC requests with mocked results
// to test the prioritization/fallback logic of the receipt fetching in the EthClient.
type ReceiptsTestCase struct {
name string
providerKind RPCProviderKind
setup func(t *testing.T) (*rpcBlock, []ReceiptsRequest)
}
func (tc *ReceiptsTestCase) Run(t *testing.T) {
srv := rpc.NewServer()
defer srv.Stop()
m := &mock.Mock{}
require.NoError(t, srv.RegisterName("eth", &ethBackend{Mock: m}))
require.NoError(t, srv.RegisterName("alchemy", &alchemyBackend{Mock: m}))
require.NoError(t, srv.RegisterName("debug", &debugBackend{Mock: m}))
require.NoError(t, srv.RegisterName("parity", &parityBackend{Mock: m}))
block, requests := tc.setup(t)
// always expect a block request to fetch txs and receipts root hash etc.
m.On("eth_getBlockByHash", block.Hash, true).Once().Return(block)
for _, reqData := range requests {
req := reqData
// depending on the method, expect to serve receipts by request(s)
switch req.method {
case EthGetTransactionReceiptBatch:
for i, tx := range block.Transactions {
m.On("eth_getTransactionReceipt", tx.Hash()).Once().Return(req.result[i], &req.err)
}
case AlchemyGetTransactionReceipts:
m.On("alchemy_getTransactionReceipts", block.Hash.String()).Once().Return(req.result, &req.err)
case DebugGetRawReceipts:
var raw []hexutil.Bytes
for _, r := range req.result {
data, err := r.MarshalBinary()
require.NoError(t, err)
raw = append(raw, data)
}
m.On("debug_getRawReceipts", block.Hash.String()).Once().Return(raw, &req.err)
case ParityGetBlockReceipts:
m.On("parity_getBlockReceipts", block.Hash.String()).Once().Return(req.result, &req.err)
case EthGetBlockReceipts:
m.On("eth_getBlockReceipts", block.Hash.String()).Once().Return(req.result, &req.err)
default:
t.Fatalf("unrecognized request method: %d", uint64(req.method))
}
}
cl := rpc.DialInProc(srv)
testCfg := &EthClientConfig{
// receipts and transactions are cached per block
ReceiptsCacheSize: 1000,
TransactionsCacheSize: 1000,
HeadersCacheSize: 1000,
PayloadsCacheSize: 1000,
MaxRequestsPerBatch: 20,
MaxConcurrentRequests: 10,
TrustRPC: false,
MustBePostMerge: false,
RPCProviderKind: tc.providerKind,
}
logger := testlog.Logger(t, log.LvlError)
ethCl, err := NewEthClient(client.NewBaseRPCClient(cl), logger, nil, testCfg)
require.NoError(t, err)
defer ethCl.Close()
for i, req := range requests {
info, result, err := ethCl.FetchReceipts(context.Background(), block.Hash)
if err == nil {
require.Nil(t, req.err, "error")
require.Equal(t, block.Hash, info.Hash(), fmt.Sprintf("req %d blockhash", i))
expectedJson, err := json.MarshalIndent(req.result, "", " ")
require.NoError(t, err)
gotJson, err := json.MarshalIndent(result, "", " ")
require.NoError(t, err)
require.Equal(t, string(expectedJson), string(gotJson), fmt.Sprintf("req %d result", i))
} else {
require.NotNil(t, req.err, "error")
require.Equal(t, req.err.Error(), err.Error(), fmt.Sprintf("req %d err", i))
}
}
m.AssertExpectations(t)
}
func randomRpcBlockAndReceipts(rng *rand.Rand, txCount uint64) (*rpcBlock, []*types.Receipt) {
block, receipts := testutils.RandomBlock(rng, txCount)
return &rpcBlock{
rpcHeader: rpcHeader{
ParentHash: block.ParentHash(),
UncleHash: block.UncleHash(),
Coinbase: block.Coinbase(),
Root: block.Root(),
TxHash: block.TxHash(),
ReceiptHash: block.ReceiptHash(),
Bloom: eth.Bytes256(block.Bloom()),
Difficulty: *(*hexutil.Big)(block.Difficulty()),
Number: hexutil.Uint64(block.NumberU64()),
GasLimit: hexutil.Uint64(block.GasLimit()),
GasUsed: hexutil.Uint64(block.GasUsed()),
Time: hexutil.Uint64(block.Time()),
Extra: hexutil.Bytes(block.Extra()),
MixDigest: block.MixDigest(),
Nonce: types.EncodeNonce(block.Nonce()),
BaseFee: (*hexutil.Big)(block.BaseFee()),
Hash: block.Hash(),
},
Transactions: block.Transactions(),
}, receipts
}
func TestEthClient_FetchReceipts(t *testing.T) {
// Helper to quickly define the test case requests scenario:
// each method fails to fetch the receipts, except the last
fallbackCase := func(txCount uint64, methods ...ReceiptsFetchingMethod) func(t *testing.T) (*rpcBlock, []ReceiptsRequest) {
return func(t *testing.T) (*rpcBlock, []ReceiptsRequest) {
block, receipts := randomRpcBlockAndReceipts(rand.New(rand.NewSource(123)), txCount)
// zero out the data we don't want to verify
for _, r := range receipts {
r.ContractAddress = common.Address{}
}
var out []ReceiptsRequest
for _, m := range methods {
out = append(out, ReceiptsRequest{
method: m,
})
}
// all but the last request fail to fetch receipts
for i := 0; i < len(out)-1; i++ {
out[i].result = nil
out[i].err = new(methodNotFoundError)
}
// last request fetches receipts
out[len(out)-1].result = receipts
return block, out
}
}
testCases := []ReceiptsTestCase{
{
name: "alchemy",
providerKind: RPCKindAlchemy,
setup: fallbackCase(30, AlchemyGetTransactionReceipts),
},
{
name: "alchemy fallback 1",
providerKind: RPCKindAlchemy,
setup: fallbackCase(40, AlchemyGetTransactionReceipts, EthGetBlockReceipts),
},
{
name: "alchemy low tx count cost saving",
providerKind: RPCKindAlchemy,
// when it's cheaper to fetch individual receipts than the alchemy-bundled receipts we change methods.
setup: fallbackCase(5, EthGetTransactionReceiptBatch),
},
{
name: "quicknode",
providerKind: RPCKindQuickNode,
setup: fallbackCase(30, DebugGetRawReceipts),
},
{
name: "quicknode fallback 1",
providerKind: RPCKindQuickNode,
setup: fallbackCase(30,
DebugGetRawReceipts,
EthGetBlockReceipts,
),
},
{
name: "quicknode low tx count cost saving",
providerKind: RPCKindQuickNode,
// when it's cheaper to fetch individual receipts than the alchemy-bundled receipts we change methods.
setup: fallbackCase(5, DebugGetRawReceipts, EthGetTransactionReceiptBatch),
},
{
name: "infura",
providerKind: RPCKindInfura,
setup: fallbackCase(4, EthGetTransactionReceiptBatch),
},
{
name: "nethermind",
providerKind: RPCKindNethermind,
setup: fallbackCase(4, ParityGetBlockReceipts), // uses parity namespace method
},
{
name: "geth with debug rpc",
providerKind: RPCKindDebugGeth,
setup: fallbackCase(4, DebugGetRawReceipts),
},
{
name: "erigon",
providerKind: RPCKindErigon,
setup: fallbackCase(4, EthGetBlockReceipts),
},
{
name: "basic",
providerKind: RPCKindBasic,
setup: fallbackCase(4, EthGetTransactionReceiptBatch),
},
{
name: "any discovers alchemy",
providerKind: RPCKindAny,
setup: fallbackCase(4, AlchemyGetTransactionReceipts),
},
{
name: "any discovers parity",
providerKind: RPCKindAny,
// fallback through the least priority method: parity (nethermind supports this still)
setup: fallbackCase(4,
AlchemyGetTransactionReceipts,
DebugGetRawReceipts,
EthGetBlockReceipts,
ParityGetBlockReceipts,
),
},
}
for _, tc := range testCases {
t.Run(tc.name, tc.Run)
}
}
...@@ -5,6 +5,10 @@ import ( ...@@ -5,6 +5,10 @@ import (
"math/big" "math/big"
"math/rand" "math/rand"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/trie"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
...@@ -90,3 +94,139 @@ func NextRandomL2Ref(rng *rand.Rand, l2BlockTime uint64, parent eth.L2BlockRef, ...@@ -90,3 +94,139 @@ func NextRandomL2Ref(rng *rand.Rand, l2BlockTime uint64, parent eth.L2BlockRef,
SequenceNumber: seq, SequenceNumber: seq,
} }
} }
func InsecureRandomKey(rng *rand.Rand) *ecdsa.PrivateKey {
key, err := ecdsa.GenerateKey(crypto.S256(), rng)
if err != nil {
panic(err)
}
return key
}
func RandomLog(rng *rand.Rand) *types.Log {
topics := make([]common.Hash, rng.Intn(3))
for i := 0; i < len(topics); i++ {
topics[i] = RandomHash(rng)
}
return &types.Log{
Address: RandomAddress(rng),
Topics: topics,
Data: RandomData(rng, rng.Intn(1000)),
BlockNumber: 0,
TxHash: common.Hash{},
TxIndex: 0,
BlockHash: common.Hash{},
Index: 0,
Removed: false,
}
}
func RandomTo(rng *rand.Rand) *common.Address {
if rng.Intn(2) == 0 {
return nil
}
to := RandomAddress(rng)
return &to
}
func RandomTx(rng *rand.Rand, baseFee *big.Int, signer types.Signer) *types.Transaction {
gas := params.TxGas + uint64(rng.Int63n(2_000_000))
key := InsecureRandomKey(rng)
tip := big.NewInt(rng.Int63n(10 * params.GWei))
tx, err := types.SignNewTx(key, signer, &types.DynamicFeeTx{
ChainID: signer.ChainID(),
Nonce: rng.Uint64(),
GasTipCap: tip,
GasFeeCap: new(big.Int).Add(baseFee, tip),
Gas: gas,
To: RandomTo(rng),
Value: RandomETH(rng, 10),
Data: RandomData(rng, rng.Intn(1000)),
AccessList: nil,
})
if err != nil {
panic(err)
}
return tx
}
func RandomReceipt(rng *rand.Rand, signer types.Signer, tx *types.Transaction, txIndex uint64, cumulativeGasUsed uint64) *types.Receipt {
gasUsed := params.TxGas + uint64(rng.Int63n(int64(tx.Gas()-params.TxGas+1)))
logs := make([]*types.Log, rng.Intn(10))
for i := range logs {
logs[i] = RandomLog(rng)
}
var contractAddr common.Address
if tx.To() == nil {
sender, err := signer.Sender(tx)
if err != nil {
panic(err)
}
contractAddr = crypto.CreateAddress(sender, tx.Nonce())
}
return &types.Receipt{
Type: tx.Type(),
Status: uint64(rng.Intn(2)),
CumulativeGasUsed: cumulativeGasUsed + gasUsed,
Bloom: types.Bloom{},
Logs: logs,
TxHash: tx.Hash(),
ContractAddress: contractAddr,
GasUsed: gasUsed,
TransactionIndex: uint(txIndex),
}
}
func RandomHeader(rng *rand.Rand) *types.Header {
return &types.Header{
ParentHash: RandomHash(rng),
UncleHash: types.EmptyUncleHash,
Coinbase: RandomAddress(rng),
Root: RandomHash(rng),
TxHash: types.EmptyRootHash,
ReceiptHash: types.EmptyRootHash,
Bloom: types.Bloom{},
Difficulty: big.NewInt(0),
Number: big.NewInt(1 + rng.Int63n(100_000_000)),
GasLimit: 0,
GasUsed: 0,
Time: uint64(rng.Int63n(2_000_000_000)),
Extra: RandomData(rng, rng.Intn(33)),
MixDigest: common.Hash{},
Nonce: types.BlockNonce{},
BaseFee: big.NewInt(rng.Int63n(300_000_000_000)),
}
}
func RandomBlock(rng *rand.Rand, txCount uint64) (*types.Block, []*types.Receipt) {
header := RandomHeader(rng)
signer := types.NewLondonSigner(big.NewInt(rng.Int63n(1000)))
txs := make([]*types.Transaction, 0, txCount)
for i := uint64(0); i < txCount; i++ {
txs = append(txs, RandomTx(rng, header.BaseFee, signer))
}
receipts := make([]*types.Receipt, 0, txCount)
cumulativeGasUsed := uint64(0)
for i, tx := range txs {
r := RandomReceipt(rng, signer, tx, uint64(i), cumulativeGasUsed)
cumulativeGasUsed += r.GasUsed
receipts = append(receipts, r)
}
header.GasUsed = cumulativeGasUsed
header.GasLimit = cumulativeGasUsed + uint64(rng.Int63n(int64(cumulativeGasUsed)))
block := types.NewBlock(header, txs, nil, receipts, trie.NewStackTrie(nil))
logIndex := uint(0)
for i, r := range receipts {
r.BlockHash = block.Hash()
r.BlockNumber = block.Number()
for _, l := range r.Logs {
l.BlockHash = block.Hash()
l.BlockNumber = block.NumberU64()
l.TxIndex = uint(i)
l.TxHash = txs[i].Hash()
l.Index = logIndex
logIndex += 1
}
}
return block, receipts
}
# @eth-optimism/ci-builder # @eth-optimism/ci-builder
## 0.3.8
### Patch Changes
- 85dfa9fe2: Add echidna tests for encoding
- ea0540e51: Update the slither version to fix echidna tests
- 0f8fc58ad: Add echidna tests for Burn
## 0.3.7 ## 0.3.7
### Patch Changes ### Patch Changes
......
...@@ -51,7 +51,7 @@ RUN apt-get update && \ ...@@ -51,7 +51,7 @@ RUN apt-get update && \
apt-get install -y nodejs && \ apt-get install -y nodejs && \
npm i -g yarn && \ npm i -g yarn && \
npm i -g depcheck && \ npm i -g depcheck && \
pip install slither-analyzer==0.9.0 && \ pip install slither-analyzer==0.9.1 && \
go install gotest.tools/gotestsum@latest && \ go install gotest.tools/gotestsum@latest && \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.48.0 && \ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.48.0 && \
curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/master/install.sh | bash && \ curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/master/install.sh | bash && \
......
{ {
"name": "@eth-optimism/ci-builder", "name": "@eth-optimism/ci-builder",
"version": "0.3.7", "version": "0.3.8",
"scripts": {}, "scripts": {},
"license": "MIT", "license": "MIT",
"dependencies": {} "dependencies": {}
......
# @eth-optimism/actor-tests # @eth-optimism/actor-tests
## 0.0.16
### Patch Changes
- Updated dependencies [fe80a9488]
- Updated dependencies [827fc7b04]
- Updated dependencies [a2166dcad]
- Updated dependencies [ff09ec22d]
- Updated dependencies [85dfa9fe2]
- Updated dependencies [ba8b94a60]
- Updated dependencies [d1f9098f9]
- Updated dependencies [0f8fc58ad]
- Updated dependencies [89f70c591]
- Updated dependencies [03940c3cb]
- @eth-optimism/contracts-bedrock@0.11.1
- @eth-optimism/sdk@1.9.0
## 0.0.15 ## 0.0.15
### Patch Changes ### Patch Changes
......
{ {
"name": "@eth-optimism/actor-tests", "name": "@eth-optimism/actor-tests",
"version": "0.0.15", "version": "0.0.16",
"description": "A library and suite of tests to stress test Optimism Bedrock.", "description": "A library and suite of tests to stress test Optimism Bedrock.",
"license": "MIT", "license": "MIT",
"author": "", "author": "",
...@@ -18,9 +18,9 @@ ...@@ -18,9 +18,9 @@
"test:coverage": "yarn test" "test:coverage": "yarn test"
}, },
"dependencies": { "dependencies": {
"@eth-optimism/contracts-bedrock": "0.11.0", "@eth-optimism/contracts-bedrock": "0.11.1",
"@eth-optimism/core-utils": "^0.12.0", "@eth-optimism/core-utils": "^0.12.0",
"@eth-optimism/sdk": "^1.8.0", "@eth-optimism/sdk": "^1.9.0",
"@types/chai": "^4.2.18", "@types/chai": "^4.2.18",
"@types/chai-as-promised": "^7.1.4", "@types/chai-as-promised": "^7.1.4",
"async-mutex": "^0.3.2", "async-mutex": "^0.3.2",
......
# @eth-optimism/balance-monitor
## 0.0.2
### Patch Changes
- 63ac3a63c: Added basic balance monitoring
- 2b931bc36: Created the Balance Monitoring package
{ {
"name": "@eth-optimism/minimum-balance-agent", "name": "@eth-optimism/balance-monitor",
"version": "0.0.1", "version": "0.0.2",
"description": "Forta Agent that reports whether certain accounts have fallen below some balance", "description": "Forta Agent that reports whether certain accounts have fallen below some balance",
"homepage": "https://github.com/ethereum-optimism/optimism/tree/develop/packages/balance-monitor#readme", "homepage": "https://github.com/ethereum-optimism/optimism/tree/develop/packages/balance-monitor#readme",
"license": "MIT", "license": "MIT",
......
# @eth-optimism/common-ts # @eth-optimism/common-ts
## 0.7.0
### Minor Changes
- ab8ec365c: Updates BaseServiceV2 so that options are secret by default. Services will have to explicitly mark options as "public" for those options to be logged and included in the metadata metric.
- 9b2891852: Refactors BaseServiceV2 slightly, merges standard options with regular options
### Patch Changes
- e23f60f63: Fixes a bug in BaseServiceV2 where options were not being parsed correctly when passed into the constructor rather than via environment variables or command line arguments
- c6c9c7dbf: Adds a function for waiting for ethers providers
- ffcee1013: Make logLevel a default option of BaseServiceV2
- eceb0de1d: Adds new standard options to disable parsing variables from environment and command line.
## 0.6.8 ## 0.6.8
### Patch Changes ### Patch Changes
......
{ {
"name": "@eth-optimism/common-ts", "name": "@eth-optimism/common-ts",
"version": "0.6.8", "version": "0.7.0",
"description": "[Optimism] Advanced typescript tooling used by various services", "description": "[Optimism] Advanced typescript tooling used by various services",
"main": "dist/index", "main": "dist/index",
"types": "dist/index", "types": "dist/index",
......
...@@ -28,13 +28,14 @@ DeployerWhitelist_Test:test_owner_succeeds() (gas: 7538) ...@@ -28,13 +28,14 @@ DeployerWhitelist_Test:test_owner_succeeds() (gas: 7538)
DeployerWhitelist_Test:test_storageSlots_succeeds() (gas: 33395) DeployerWhitelist_Test:test_storageSlots_succeeds() (gas: 33395)
FeeVault_Test:test_constructor_succeeds() (gas: 10647) FeeVault_Test:test_constructor_succeeds() (gas: 10647)
FeeVault_Test:test_minWithdrawalAmount_succeeds() (gas: 10668) FeeVault_Test:test_minWithdrawalAmount_succeeds() (gas: 10668)
GasPriceOracle_Test:test_baseFee_succeeds() (gas: 8291) GasPriceOracle_Test:test_baseFee_succeeds() (gas: 8280)
GasPriceOracle_Test:test_decimals_succeeds() (gas: 6145)
GasPriceOracle_Test:test_gasPrice_succeeds() (gas: 8294) GasPriceOracle_Test:test_gasPrice_succeeds() (gas: 8294)
GasPriceOracle_Test:test_l1BaseFee_succeeds() (gas: 10656) GasPriceOracle_Test:test_l1BaseFee_succeeds() (gas: 10634)
GasPriceOracle_Test:test_overhead_succeeds() (gas: 10546) GasPriceOracle_Test:test_overhead_succeeds() (gas: 10614)
GasPriceOracle_Test:test_scalar_succeeds() (gas: 10611) GasPriceOracle_Test:test_scalar_succeeds() (gas: 10655)
GasPriceOracle_Test:test_setGasPrice_doesNotExist_reverts() (gas: 5910) GasPriceOracle_Test:test_setGasPrice_doesNotExist_reverts() (gas: 5888)
GasPriceOracle_Test:test_setL1BaseFee_doesNotExist_reverts() (gas: 5910) GasPriceOracle_Test:test_setL1BaseFee_doesNotExist_reverts() (gas: 5888)
GovernanceToken_Test:test_approve_succeeds() (gas: 133293) GovernanceToken_Test:test_approve_succeeds() (gas: 133293)
GovernanceToken_Test:test_burnFrom_succeeds() (gas: 122733) GovernanceToken_Test:test_burnFrom_succeeds() (gas: 122733)
GovernanceToken_Test:test_burn_succeeds() (gas: 114610) GovernanceToken_Test:test_burn_succeeds() (gas: 114610)
......
...@@ -154,6 +154,8 @@ ...@@ -154,6 +154,8 @@
| spacer_3_0_32 | uint256 | 3 | 0 | 32 | contracts/L2/GasPriceOracle.sol:GasPriceOracle | | spacer_3_0_32 | uint256 | 3 | 0 | 32 | contracts/L2/GasPriceOracle.sol:GasPriceOracle |
|---------------+---------+------+--------+-------+------------------------------------------------| |---------------+---------+------+--------+-------+------------------------------------------------|
| spacer_4_0_32 | uint256 | 4 | 0 | 32 | contracts/L2/GasPriceOracle.sol:GasPriceOracle | | spacer_4_0_32 | uint256 | 4 | 0 | 32 | contracts/L2/GasPriceOracle.sol:GasPriceOracle |
|---------------+---------+------+--------+-------+------------------------------------------------|
| spacer_5_0_32 | uint256 | 5 | 0 | 32 | contracts/L2/GasPriceOracle.sol:GasPriceOracle |
+---------------+---------+------+--------+-------+------------------------------------------------+ +---------------+---------+------+--------+-------+------------------------------------------------+
======================= =======================
......
# @eth-optimism/contracts-bedrock # @eth-optimism/contracts-bedrock
## 0.11.1
### Patch Changes
- fe80a9488: Add echidna tests for portal
- 827fc7b04: Adds a go package to generate fuzz inputs for the Bedrock contract tests.
- a2166dcad: Add echidna tests for metering
- ff09ec22d: Add echidna tests for hashing
- 85dfa9fe2: Add echidna tests for encoding
- 0f8fc58ad: Add echidna tests for Burn
- 89f70c591: Add tests for the `Bytes` library
- 03940c3cb: Make lint check and fix scripts match
## 0.11.0 ## 0.11.0
### Minor Changes ### Minor Changes
......
...@@ -57,10 +57,17 @@ contract GasPriceOracle is Semver { ...@@ -57,10 +57,17 @@ contract GasPriceOracle is Semver {
*/ */
uint256 private spacer_4_0_32; uint256 private spacer_4_0_32;
/**
* @custom:legacy
* @custom:spacer decimals
* @notice Spacer for backwards compatibility.
*/
uint256 private spacer_5_0_32;
/** /**
* @notice Number of decimals used in the scalar. * @notice Number of decimals used in the scalar.
*/ */
uint256 public constant decimals = 6; uint256 public constant DECIMALS = 6;
/** /**
* @custom:semver 0.0.1 * @custom:semver 0.0.1
...@@ -78,7 +85,7 @@ contract GasPriceOracle is Semver { ...@@ -78,7 +85,7 @@ contract GasPriceOracle is Semver {
function getL1Fee(bytes memory _data) external view returns (uint256) { function getL1Fee(bytes memory _data) external view returns (uint256) {
uint256 l1GasUsed = getL1GasUsed(_data); uint256 l1GasUsed = getL1GasUsed(_data);
uint256 l1Fee = l1GasUsed * l1BaseFee(); uint256 l1Fee = l1GasUsed * l1BaseFee();
uint256 divisor = 10**decimals; uint256 divisor = 10**DECIMALS;
uint256 unscaled = l1Fee * scalar(); uint256 unscaled = l1Fee * scalar();
uint256 scaled = unscaled / divisor; uint256 scaled = unscaled / divisor;
return scaled; return scaled;
...@@ -129,6 +136,16 @@ contract GasPriceOracle is Semver { ...@@ -129,6 +136,16 @@ contract GasPriceOracle is Semver {
return L1Block(Predeploys.L1_BLOCK_ATTRIBUTES).basefee(); return L1Block(Predeploys.L1_BLOCK_ATTRIBUTES).basefee();
} }
/**
* @custom:legacy
* @notice Retrieves the number of decimals used in the scalar.
*
* @return Number of decimals used in the scalar.
*/
function decimals() public pure returns (uint256) {
return DECIMALS;
}
/** /**
* @notice Computes the amount of L1 gas used for a transaction. Adds the overhead which * @notice Computes the amount of L1 gas used for a transaction. Adds the overhead which
* represents the per-transaction gas overhead of posting the transaction and state * represents the per-transaction gas overhead of posting the transaction and state
......
...@@ -74,6 +74,11 @@ contract GasPriceOracle_Test is CommonTest { ...@@ -74,6 +74,11 @@ contract GasPriceOracle_Test is CommonTest {
assertEq(gasOracle.overhead(), l1FeeOverhead); assertEq(gasOracle.overhead(), l1FeeOverhead);
} }
function test_decimals_succeeds() external {
assertEq(gasOracle.decimals(), 6);
assertEq(gasOracle.DECIMALS(), 6);
}
// Removed in bedrock // Removed in bedrock
function test_setGasPrice_doesNotExist_reverts() external { function test_setGasPrice_doesNotExist_reverts() external {
(bool success, bytes memory returndata) = address(gasOracle).call( (bool success, bytes memory returndata) = address(gasOracle).call(
......
{ {
"name": "@eth-optimism/contracts-bedrock", "name": "@eth-optimism/contracts-bedrock",
"version": "0.11.0", "version": "0.11.1",
"description": "Contracts for Optimism Specs", "description": "Contracts for Optimism Specs",
"main": "dist/index", "main": "dist/index",
"types": "dist/index", "types": "dist/index",
......
# @eth-optimism/contracts-periphery # @eth-optimism/contracts-periphery
## 1.0.5
### Patch Changes
- fe8f2afd0: Minor fix to AttestationStation test
- 886fec5bb: Add attestation contracts
- 596d51852: Update zeppelin deps in contracts periphery
- c12aeb2f9: Add deploy script for attestations tation
- a610b4f3b: Make zeppelin deps in contracts periphery not get hoisted
- 55515ba14: Add some default options to optimist config
- bf5f9febd: Add authors to optimist contracts
- 9a996a13c: Make deploy scripts a little safer
- 09924e8ed: Add test coverage script to contracts periphery
- 746ce5545: Add deployment scripts for optimist
- 0e0546a11: Add optimist contract
## 1.0.4 ## 1.0.4
### Patch Changes ### Patch Changes
......
{ {
"name": "@eth-optimism/contracts-periphery", "name": "@eth-optimism/contracts-periphery",
"version": "1.0.4", "version": "1.0.5",
"description": "[Optimism] External (out-of-protocol) L1 and L2 smart contracts for Optimism", "description": "[Optimism] External (out-of-protocol) L1 and L2 smart contracts for Optimism",
"main": "dist/index", "main": "dist/index",
"types": "dist/index", "types": "dist/index",
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
}, },
"devDependencies": { "devDependencies": {
"@defi-wonderland/smock": "^2.0.7", "@defi-wonderland/smock": "^2.0.7",
"@eth-optimism/contracts-bedrock": "0.10.0", "@eth-optimism/contracts-bedrock": "0.11.0",
"@eth-optimism/core-utils": "^0.12.0", "@eth-optimism/core-utils": "^0.12.0",
"@eth-optimism/hardhat-deploy-config": "^0.2.5", "@eth-optimism/hardhat-deploy-config": "^0.2.5",
"@ethersproject/hardware-wallets": "^5.7.0", "@ethersproject/hardware-wallets": "^5.7.0",
......
# Changelog # Changelog
## 0.5.40
### Patch Changes
- d1f9098f9: Removes support for Kovan
## 0.5.39 ## 0.5.39
### Patch Changes ### Patch Changes
......
{ {
"name": "@eth-optimism/contracts", "name": "@eth-optimism/contracts",
"version": "0.5.39", "version": "0.5.40",
"description": "[Optimism] L1 and L2 smart contracts for Optimism", "description": "[Optimism] L1 and L2 smart contracts for Optimism",
"main": "dist/index", "main": "dist/index",
"types": "dist/index", "types": "dist/index",
......
# data transport layer # data transport layer
## 0.5.50
### Patch Changes
- 9b2891852: Refactors BaseServiceV2 slightly, merges standard options with regular options
- Updated dependencies [e23f60f63]
- Updated dependencies [ab8ec365c]
- Updated dependencies [9b2891852]
- Updated dependencies [d1f9098f9]
- Updated dependencies [c6c9c7dbf]
- Updated dependencies [ffcee1013]
- Updated dependencies [eceb0de1d]
- @eth-optimism/common-ts@0.7.0
- @eth-optimism/contracts@0.5.40
## 0.5.49 ## 0.5.49
### Patch Changes ### Patch Changes
......
{ {
"private": true, "private": true,
"name": "@eth-optimism/data-transport-layer", "name": "@eth-optimism/data-transport-layer",
"version": "0.5.49", "version": "0.5.50",
"description": "[Optimism] Service for shuttling data from L1 into L2", "description": "[Optimism] Service for shuttling data from L1 into L2",
"main": "dist/index", "main": "dist/index",
"types": "dist/index", "types": "dist/index",
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
"url": "https://github.com/ethereum-optimism/optimism.git" "url": "https://github.com/ethereum-optimism/optimism.git"
}, },
"dependencies": { "dependencies": {
"@eth-optimism/common-ts": "0.6.8", "@eth-optimism/common-ts": "0.7.0",
"@eth-optimism/contracts": "0.5.39", "@eth-optimism/contracts": "0.5.40",
"@eth-optimism/core-utils": "0.12.0", "@eth-optimism/core-utils": "0.12.0",
"@ethersproject/providers": "^5.7.0", "@ethersproject/providers": "^5.7.0",
"@ethersproject/transactions": "^5.7.0", "@ethersproject/transactions": "^5.7.0",
......
# @eth-optimism/drippie-mon # @eth-optimism/drippie-mon
## 0.4.0
### Minor Changes
- 9b2891852: Refactors BaseServiceV2 slightly, merges standard options with regular options
### Patch Changes
- ab8ec365c: Updates BaseServiceV2 so that options are secret by default. Services will have to explicitly mark options as "public" for those options to be logged and included in the metadata metric.
- Updated dependencies [fe8f2afd0]
- Updated dependencies [e23f60f63]
- Updated dependencies [886fec5bb]
- Updated dependencies [596d51852]
- Updated dependencies [ab8ec365c]
- Updated dependencies [c12aeb2f9]
- Updated dependencies [a610b4f3b]
- Updated dependencies [55515ba14]
- Updated dependencies [ba8b94a60]
- Updated dependencies [9b2891852]
- Updated dependencies [d1f9098f9]
- Updated dependencies [c6c9c7dbf]
- Updated dependencies [bf5f9febd]
- Updated dependencies [ffcee1013]
- Updated dependencies [9a996a13c]
- Updated dependencies [09924e8ed]
- Updated dependencies [746ce5545]
- Updated dependencies [eceb0de1d]
- Updated dependencies [0e0546a11]
- @eth-optimism/contracts-periphery@1.0.5
- @eth-optimism/common-ts@0.7.0
- @eth-optimism/sdk@1.9.0
## 0.3.24 ## 0.3.24
### Patch Changes ### Patch Changes
......
{ {
"private": true, "private": true,
"name": "@eth-optimism/drippie-mon", "name": "@eth-optimism/drippie-mon",
"version": "0.3.24", "version": "0.4.0",
"description": "[Optimism] Service for monitoring Drippie instances", "description": "[Optimism] Service for monitoring Drippie instances",
"main": "dist/index", "main": "dist/index",
"types": "dist/index", "types": "dist/index",
...@@ -32,10 +32,10 @@ ...@@ -32,10 +32,10 @@
"url": "https://github.com/ethereum-optimism/optimism.git" "url": "https://github.com/ethereum-optimism/optimism.git"
}, },
"dependencies": { "dependencies": {
"@eth-optimism/common-ts": "0.6.8", "@eth-optimism/common-ts": "0.7.0",
"@eth-optimism/contracts-periphery": "1.0.4", "@eth-optimism/contracts-periphery": "1.0.5",
"@eth-optimism/core-utils": "0.12.0", "@eth-optimism/core-utils": "0.12.0",
"@eth-optimism/sdk": "1.8.0", "@eth-optimism/sdk": "1.9.0",
"ethers": "^5.7.0" "ethers": "^5.7.0"
}, },
"devDependencies": { "devDependencies": {
......
# @eth-optimism/fault-detector # @eth-optimism/fault-detector
## 0.5.0
### Minor Changes
- 9b2891852: Refactors BaseServiceV2 slightly, merges standard options with regular options
### Patch Changes
- ab8ec365c: Updates BaseServiceV2 so that options are secret by default. Services will have to explicitly mark options as "public" for those options to be logged and included in the metadata metric.
- c6c9c7dbf: Fault detector will now wait for providers to be connected
- Updated dependencies [e23f60f63]
- Updated dependencies [ab8ec365c]
- Updated dependencies [ba8b94a60]
- Updated dependencies [9b2891852]
- Updated dependencies [d1f9098f9]
- Updated dependencies [c6c9c7dbf]
- Updated dependencies [ffcee1013]
- Updated dependencies [eceb0de1d]
- @eth-optimism/common-ts@0.7.0
- @eth-optimism/sdk@1.9.0
- @eth-optimism/contracts@0.5.40
## 0.4.0 ## 0.4.0
### Minor Changes ### Minor Changes
......
{ {
"private": true, "private": true,
"name": "@eth-optimism/fault-detector", "name": "@eth-optimism/fault-detector",
"version": "0.4.0", "version": "0.5.0",
"description": "[Optimism] Service for detecting faulty L2 output proposals", "description": "[Optimism] Service for detecting faulty L2 output proposals",
"main": "dist/index", "main": "dist/index",
"types": "dist/index", "types": "dist/index",
...@@ -47,10 +47,10 @@ ...@@ -47,10 +47,10 @@
"ts-node": "^10.9.1" "ts-node": "^10.9.1"
}, },
"dependencies": { "dependencies": {
"@eth-optimism/common-ts": "^0.6.8", "@eth-optimism/common-ts": "^0.7.0",
"@eth-optimism/contracts": "^0.5.39", "@eth-optimism/contracts": "^0.5.40",
"@eth-optimism/core-utils": "^0.12.0", "@eth-optimism/core-utils": "^0.12.0",
"@eth-optimism/sdk": "^1.8.0", "@eth-optimism/sdk": "^1.9.0",
"@ethersproject/abstract-provider": "^5.7.0" "@ethersproject/abstract-provider": "^5.7.0"
} }
} }
# @eth-optimism/message-relayer # @eth-optimism/message-relayer
## 0.5.24
### Patch Changes
- Updated dependencies [e23f60f63]
- Updated dependencies [ab8ec365c]
- Updated dependencies [ba8b94a60]
- Updated dependencies [9b2891852]
- Updated dependencies [d1f9098f9]
- Updated dependencies [c6c9c7dbf]
- Updated dependencies [ffcee1013]
- Updated dependencies [eceb0de1d]
- @eth-optimism/common-ts@0.7.0
- @eth-optimism/sdk@1.9.0
## 0.5.23 ## 0.5.23
### Patch Changes ### Patch Changes
......
{ {
"private": true, "private": true,
"name": "@eth-optimism/message-relayer", "name": "@eth-optimism/message-relayer",
"version": "0.5.23", "version": "0.5.24",
"description": "[Optimism] Service for automatically relaying L2 to L1 transactions", "description": "[Optimism] Service for automatically relaying L2 to L1 transactions",
"main": "dist/index", "main": "dist/index",
"types": "dist/index", "types": "dist/index",
...@@ -31,9 +31,9 @@ ...@@ -31,9 +31,9 @@
"url": "https://github.com/ethereum-optimism/optimism.git" "url": "https://github.com/ethereum-optimism/optimism.git"
}, },
"dependencies": { "dependencies": {
"@eth-optimism/common-ts": "0.6.8", "@eth-optimism/common-ts": "0.7.0",
"@eth-optimism/core-utils": "0.12.0", "@eth-optimism/core-utils": "0.12.0",
"@eth-optimism/sdk": "1.8.0", "@eth-optimism/sdk": "1.9.0",
"ethers": "^5.7.0" "ethers": "^5.7.0"
}, },
"devDependencies": { "devDependencies": {
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
}, },
"devDependencies": { "devDependencies": {
"commander": "^9.0.0", "commander": "^9.0.0",
"@eth-optimism/contracts": "0.5.39", "@eth-optimism/contracts": "0.5.40",
"@eth-optimism/old-contracts": "npm:@eth-optimism/contracts@0.4.10", "@eth-optimism/old-contracts": "npm:@eth-optimism/contracts@0.4.10",
"ethers": "^5.7.0", "ethers": "^5.7.0",
"ts-node": "^10.9.1" "ts-node": "^10.9.1"
......
# @eth-optimism/replica-healthcheck # @eth-optimism/replica-healthcheck
## 1.2.0
### Minor Changes
- 9b2891852: Refactors BaseServiceV2 slightly, merges standard options with regular options
### Patch Changes
- ab8ec365c: Updates BaseServiceV2 so that options are secret by default. Services will have to explicitly mark options as "public" for those options to be logged and included in the metadata metric.
- Updated dependencies [e23f60f63]
- Updated dependencies [ab8ec365c]
- Updated dependencies [9b2891852]
- Updated dependencies [c6c9c7dbf]
- Updated dependencies [ffcee1013]
- Updated dependencies [eceb0de1d]
- @eth-optimism/common-ts@0.7.0
## 1.1.13 ## 1.1.13
### Patch Changes ### Patch Changes
......
{ {
"private": true, "private": true,
"name": "@eth-optimism/replica-healthcheck", "name": "@eth-optimism/replica-healthcheck",
"version": "1.1.13", "version": "1.2.0",
"description": "[Optimism] Service for monitoring the health of replica nodes", "description": "[Optimism] Service for monitoring the health of replica nodes",
"main": "dist/index", "main": "dist/index",
"types": "dist/index", "types": "dist/index",
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
"url": "https://github.com/ethereum-optimism/optimism.git" "url": "https://github.com/ethereum-optimism/optimism.git"
}, },
"dependencies": { "dependencies": {
"@eth-optimism/common-ts": "0.6.8", "@eth-optimism/common-ts": "0.7.0",
"@eth-optimism/core-utils": "0.12.0", "@eth-optimism/core-utils": "0.12.0",
"@ethersproject/abstract-provider": "^5.7.0" "@ethersproject/abstract-provider": "^5.7.0"
}, },
......
# @eth-optimism/sdk # @eth-optimism/sdk
## 1.9.0
### Minor Changes
- d1f9098f9: Removes support for Kovan
### Patch Changes
- ba8b94a60: Don't pass 0 gasLimit for migrated withdrawals
- Updated dependencies [fe80a9488]
- Updated dependencies [827fc7b04]
- Updated dependencies [a2166dcad]
- Updated dependencies [ff09ec22d]
- Updated dependencies [85dfa9fe2]
- Updated dependencies [d1f9098f9]
- Updated dependencies [0f8fc58ad]
- Updated dependencies [89f70c591]
- Updated dependencies [03940c3cb]
- @eth-optimism/contracts-bedrock@0.11.1
- @eth-optimism/contracts@0.5.40
## 1.8.0 ## 1.8.0
### Minor Changes ### Minor Changes
......
{ {
"name": "@eth-optimism/sdk", "name": "@eth-optimism/sdk",
"version": "1.8.0", "version": "1.9.0",
"description": "[Optimism] Tools for working with Optimism", "description": "[Optimism] Tools for working with Optimism",
"main": "dist/index", "main": "dist/index",
"types": "dist/index", "types": "dist/index",
...@@ -48,9 +48,9 @@ ...@@ -48,9 +48,9 @@
"mocha": "^10.0.0" "mocha": "^10.0.0"
}, },
"dependencies": { "dependencies": {
"@eth-optimism/contracts": "0.5.39", "@eth-optimism/contracts": "0.5.40",
"@eth-optimism/core-utils": "0.12.0", "@eth-optimism/core-utils": "0.12.0",
"@eth-optimism/contracts-bedrock": "0.11.0", "@eth-optimism/contracts-bedrock": "0.11.1",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"merkletreejs": "^0.2.27", "merkletreejs": "^0.2.27",
"rlp": "^2.2.7" "rlp": "^2.2.7"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment