Commit 82255d5e authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub

Merge branch 'develop' into indexer.bytes.serialization

parents 1c0f9310 e3f7b718
......@@ -1053,59 +1053,6 @@ jobs:
name: "Go mod tidy"
command: make mod-tidy && git diff --exit-code
hive-test:
parameters:
version:
type: string
default: develop
sim:
type: string
machine:
image: ubuntu-2204:2022.10.2
docker_layer_caching: true
resource_class: large
steps:
- attach_workspace:
at: /tmp/docker_images
- run:
name: Docker Load
command: |
docker load -i /tmp/docker_images/op-batcher_<<parameters.version>>.tar
docker load -i /tmp/docker_images/op-proposer_<<parameters.version>>.tar
docker load -i /tmp/docker_images/op-node_<<parameters.version>>.tar
- run:
command: git clone https://github.com/ethereum-optimism/hive.git .
- go/load-cache
- go/mod-download
- go/save-cache
- run: { command: "go build ." }
- run: { command: "go build junit/junitformatter.go" }
- run:
command: |
./hive \
-sim=<<parameters.sim>> \
-sim.loglevel=5 \
-client=go-ethereum_v1.11.6,op-geth_optimism,op-proposer_<<parameters.version>>,op-batcher_<<parameters.version>>,op-node_<<parameters.version>> |& tee /tmp/hive.log
- run:
command: |
tar -cvf /tmp/workspace.tgz -C /home/circleci/project /home/circleci/project/workspace
name: "Archive workspace"
when: always
- run:
command: |
./junitformatter /home/circleci/project/workspace/logs/*.json > /home/circleci/project/workspace/logs/junit.xml
when: always
- store_artifacts:
path: /tmp/workspace.tgz
destination: hive-workspace.tgz
when: always
- store_test_results:
path: /home/circleci/project/workspace/logs/junit.xml
when: always
- store_artifacts:
path: /home/circleci/project/workspace/logs/junit.xml
when: always
bedrock-go-tests:
docker:
- image: cimg/go:1.20
......@@ -1423,33 +1370,6 @@ workflows:
docker_target: wd-mon
context:
- oplabs-gcr
- hive-test:
name: hive-test-rpc
version: <<pipeline.git.revision>>
sim: optimism/rpc
requires:
- op-node-docker-build
- op-batcher-docker-build
- op-proposer-docker-build
- op-challenger-docker-build
- hive-test:
name: hive-test-p2p
version: <<pipeline.git.revision>>
sim: optimism/p2p
requires:
- op-node-docker-build
- op-batcher-docker-build
- op-proposer-docker-build
- op-challenger-docker-build
- hive-test:
name: hive-test-l1ops
version: <<pipeline.git.revision>>
sim: optimism/l1ops
requires:
- op-node-docker-build
- op-batcher-docker-build
- op-proposer-docker-build
- op-challenger-docker-build
- check-generated-mocks-op-node
- check-generated-mocks-op-service
- cannon-go-lint-and-test
......
......@@ -15,12 +15,14 @@ import (
"github.com/ethereum-optimism/optimism/op-challenger/fault/alphabet"
"github.com/ethereum-optimism/optimism/op-challenger/fault/cannon"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/challenger"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/transactions"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/wait"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
......@@ -106,14 +108,9 @@ func (h *FactoryHelper) StartAlphabetGame(ctx context.Context, claimedAlphabet s
extraData := make([]byte, 64)
binary.BigEndian.PutUint64(extraData[24:], l2BlockNumber)
binary.BigEndian.PutUint64(extraData[56:], l1Head.Uint64())
h.opts.NoSend = true
tx, err := h.factory.Create(h.opts, alphabetGameType, rootClaim, extraData)
h.require.NoError(err, "create fault dispute game (estimate gas)")
// Now send with increased gas. This provides a buffer if the output oracle search is now more expensive
h.opts.NoSend = false
h.opts.GasLimit = tx.Gas() * 2
tx, err = h.factory.Create(h.opts, alphabetGameType, rootClaim, extraData)
tx, err := transactions.PadGasEstimate(h.opts, 2, func(opts *bind.TransactOpts) (*types.Transaction, error) {
return h.factory.Create(opts, alphabetGameType, rootClaim, extraData)
})
h.require.NoError(err, "create fault dispute game")
h.opts.GasLimit = 0
rcpt, err := wait.ForReceiptOK(ctx, h.client, tx.Hash())
......@@ -199,16 +196,10 @@ func (h *FactoryHelper) createCannonGame(ctx context.Context, l2BlockNumber uint
extraData := make([]byte, 64)
binary.BigEndian.PutUint64(extraData[24:], l2BlockNumber)
binary.BigEndian.PutUint64(extraData[56:], l1Head.Uint64())
h.opts.NoSend = true
tx, err := h.factory.Create(h.opts, cannonGameType, rootClaim, extraData)
h.require.NoError(err, "create fault dispute game (estimate gas)")
// Now send with increased gas. This provides a buffer if the output oracle search is now more expensive
h.opts.NoSend = false
h.opts.GasLimit = tx.Gas() * 2
tx, err = h.factory.Create(h.opts, cannonGameType, rootClaim, extraData)
tx, err := transactions.PadGasEstimate(h.opts, 2, func(opts *bind.TransactOpts) (*types.Transaction, error) {
return h.factory.Create(opts, cannonGameType, rootClaim, extraData)
})
h.require.NoError(err, "create fault dispute game")
h.opts.GasLimit = 0
rcpt, err := wait.ForReceiptOK(ctx, h.client, tx.Hash())
h.require.NoError(err, "wait for create fault dispute game receipt to be OK")
h.require.Len(rcpt.Logs, 1, "should have emitted a single DisputeGameCreated event")
......
package transactions
import (
"fmt"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/core/types"
)
// TxBuilder creates and sends a transaction using the supplied bind.TransactOpts.
// Returns the created transaction and any error reported.
type TxBuilder func(opts *bind.TransactOpts) (*types.Transaction, error)
// PadGasEstimate multiplies the gas estimate for a transaction by the specified paddingFactor before sending the
// actual transaction. Useful for cases where the gas required is variable.
// The builder will be invoked twice, first with NoSend=true to estimate the gas and the second time with
// NoSend=false and GasLimit including the requested padding.
func PadGasEstimate(opts *bind.TransactOpts, paddingFactor float64, builder TxBuilder) (*types.Transaction, error) {
// Take a copy of the opts to avoid mutating the original
o := *opts
o.NoSend = true
tx, err := builder(&o)
if err != nil {
return nil, fmt.Errorf("failed to estimate gas: %w", err)
}
gas := float64(tx.Gas()) * paddingFactor
o.GasLimit = uint64(gas)
o.NoSend = false
return builder(&o)
}
......@@ -8,6 +8,7 @@ import (
"time"
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/transactions"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
......@@ -29,19 +30,12 @@ func SendDepositTx(t *testing.T, cfg SystemConfig, l1Client *ethclient.Client, l
require.Nil(t, err)
// Finally send TX
l1Opts.NoSend = true
tx, err := depositContract.DepositTransaction(l1Opts, l2Opts.ToAddr, l2Opts.Value, l2Opts.GasLimit, l2Opts.IsCreation, l2Opts.Data)
require.Nil(t, err, "with deposit tx")
l1Opts.NoSend = false
// Add 10% padding for the L1 gas limit because the estimation process can be affected by the 1559 style cost scale
// for buying L2 gas in the portal contracts.
l1Opts.GasLimit = tx.Gas() + (tx.Gas() / 10)
// Now resend with gas specified
tx, err = depositContract.DepositTransaction(l1Opts, l2Opts.ToAddr, l2Opts.Value, l2Opts.GasLimit, l2Opts.IsCreation, l2Opts.Data)
tx, err := transactions.PadGasEstimate(l1Opts, 1.1, func(opts *bind.TransactOpts) (*types.Transaction, error) {
return depositContract.DepositTransaction(opts, l2Opts.ToAddr, l2Opts.Value, l2Opts.GasLimit, l2Opts.IsCreation, l2Opts.Data)
})
require.Nil(t, err, "with deposit tx")
l1Opts.GasLimit = 0
// Wait for transaction on L1
receipt, err := waitForTransaction(tx.Hash(), l1Client, 10*time.Duration(cfg.DeployConfig.L1BlockTime)*time.Second)
......
......@@ -50,7 +50,8 @@ var (
// Banning Flag - whether or not we want to act on the scoring
Banning = &cli.BoolFlag{
Name: "p2p.ban.peers",
Usage: "Enables peer banning. This should ONLY be enabled once certain peer scoring is working correctly.",
Usage: "Enables peer banning.",
Value: true,
Required: false,
EnvVars: p2pEnv("PEER_BANNING"),
}
......
......@@ -68,7 +68,7 @@
"markdownlint-cli2": "0.4.0",
"mkdirp": "^1.0.4",
"mocha": "^10.2.0",
"nx": "16.7.1",
"nx": "16.7.2",
"nyc": "^15.1.0",
"patch-package": "^8.0.0",
"prettier": "^2.8.0",
......
......@@ -109,8 +109,8 @@ importers:
specifier: ^10.2.0
version: 10.2.0
nx:
specifier: 16.7.1
version: 16.7.1
specifier: 16.7.2
version: 16.7.2
nyc:
specifier: ^15.1.0
version: 15.1.0
......@@ -2517,7 +2517,7 @@ packages:
dependencies:
'@lerna/child-process': 7.1.5
'@npmcli/run-script': 6.0.2
'@nx/devkit': 16.7.1(nx@16.7.1)
'@nx/devkit': 16.7.1(nx@16.7.2)
'@octokit/plugin-enterprise-rest': 6.0.1
'@octokit/rest': 19.0.11
byte-size: 8.1.1
......@@ -2553,7 +2553,7 @@ packages:
npm-packlist: 5.1.1
npm-registry-fetch: 14.0.5
npmlog: 6.0.2
nx: 16.7.1
nx: 16.7.2
p-map: 4.0.0
p-map-series: 2.1.0
p-queue: 6.6.2
......@@ -2838,10 +2838,10 @@ packages:
- supports-color
dev: true
/@nrwl/devkit@16.7.1(nx@16.7.1):
/@nrwl/devkit@16.7.1(nx@16.7.2):
resolution: {integrity: sha512-ysAgNju6o7QjG/ZHW0wIRJ8yWxjhErjqQ8GZ2Smqsb1myrr6UbYsuxaXjoOHI56fMmGyNPK04zzyNXXWQw/UAA==}
dependencies:
'@nx/devkit': 16.7.1(nx@16.7.1)
'@nx/devkit': 16.7.1(nx@16.7.2)
transitivePeerDependencies:
- nx
dev: true
......@@ -2854,11 +2854,11 @@ packages:
- debug
dev: true
/@nrwl/tao@16.7.1:
resolution: {integrity: sha512-oIjph3gm+FOB8mB2OTfCejQykpY+LGKdrGe5RpO3fBZzrkADHTdRWhaqaxktmGcRRt1AwMBofEv3mH4+VUOa/g==}
/@nrwl/tao@16.7.2:
resolution: {integrity: sha512-4Wc3ic5VtZL3t4qqCMJlEad/wWuFxNUX78U5ohEStN3UFFJIjwJJpKZYZDtxhaOLWUdXbk6CI3KfSIpWgwPdbQ==}
hasBin: true
dependencies:
nx: 16.7.1
nx: 16.7.2
tslib: 2.6.0
transitivePeerDependencies:
- '@swc-node/register'
......@@ -2866,23 +2866,23 @@ packages:
- debug
dev: true
/@nx/devkit@16.7.1(nx@16.7.1):
/@nx/devkit@16.7.1(nx@16.7.2):
resolution: {integrity: sha512-PASQGd1YhcAA/hpupCsSakP71Qh1pYle4dtF+wh3KDe2kdeM6BgccClapiGcXAI46JKLUGAbNYJ8pg7GEPY5Nw==}
peerDependencies:
nx: '>= 15 <= 17'
dependencies:
'@nrwl/devkit': 16.7.1(nx@16.7.1)
'@nrwl/devkit': 16.7.1(nx@16.7.2)
ejs: 3.1.9
enquirer: 2.3.6
ignore: 5.2.4
nx: 16.7.1
nx: 16.7.2
semver: 7.5.3
tmp: 0.2.1
tslib: 2.6.0
dev: true
/@nx/nx-darwin-arm64@16.7.1:
resolution: {integrity: sha512-g9N0eOYyirOnVZdpzsmby2VX2ovL/QBzjvT5OlLteKE4XmvksgSjQAhQeUUNY772AW6HoIK5MVxS2Jg3PECatQ==}
/@nx/nx-darwin-arm64@16.7.2:
resolution: {integrity: sha512-dkTHAzOTbqRHUQtnw7knEJq4ll6hew11u+9B0fThs9gC/X0iPK0eDXD4TqbIKEbcWAsxpuGiWPzGoNPo7Gwl9A==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [darwin]
......@@ -2890,8 +2890,8 @@ packages:
dev: true
optional: true
/@nx/nx-darwin-x64@16.7.1:
resolution: {integrity: sha512-ZoV4J4pR6z7YtBJoxrdNJTYJmjY653iA2M31PZL/WaS/3SHfzf4YYsnbLK5sF6GJI9n0XmOh3mPPHoJMYbQPIQ==}
/@nx/nx-darwin-x64@16.7.2:
resolution: {integrity: sha512-EKhjX7DCRIA5U8yAxIgGXeIFaq1dhgLJy8OAG4n1Ud8c21px+bBSrcZvv0ww5VoEulhggQ+c6fW1cjKtGgLknQ==}
engines: {node: '>= 10'}
cpu: [x64]
os: [darwin]
......@@ -2899,8 +2899,8 @@ packages:
dev: true
optional: true
/@nx/nx-freebsd-x64@16.7.1:
resolution: {integrity: sha512-vpAi4FHtNwcBIjkRf86Oa98r09oN5OirCXT7cInvwCZWRMVUxT5WHs6gEMY1lvMlnTWqAVdWPcec5VipI9EhQA==}
/@nx/nx-freebsd-x64@16.7.2:
resolution: {integrity: sha512-3QhXZq0wxvi4lg1MJqwq72F7PE/d0Hcl3uwheenYQtwUvAFAmijC/Z4AVPSqbKJ+QaoqASnXRim9z3EIfeD+DQ==}
engines: {node: '>= 10'}
cpu: [x64]
os: [freebsd]
......@@ -2908,8 +2908,8 @@ packages:
dev: true
optional: true
/@nx/nx-linux-arm-gnueabihf@16.7.1:
resolution: {integrity: sha512-In9qaTpUPsle1jf20lBV/c0WrfSo4Qy64OleweZwIea3RW1TsQg4xxORoULtkU+6KB85XOb5Xd5G/zXpLRMykw==}
/@nx/nx-linux-arm-gnueabihf@16.7.2:
resolution: {integrity: sha512-7bny8NvE9iyfwRfq9/mOZjzMNWthT70Ce1N9suB2zdbgbLUEDPQQhBNbg969yT6/LbWMWuWZXeIbz/Fwndf9zA==}
engines: {node: '>= 10'}
cpu: [arm]
os: [linux]
......@@ -2917,8 +2917,8 @@ packages:
dev: true
optional: true
/@nx/nx-linux-arm64-gnu@16.7.1:
resolution: {integrity: sha512-+RXFQqGl5SLrcFl0zKAZOZ4pgA3yhXZnI2xYnuhlPOvuNT4Flc6cdPPz12uKhkWIg0nEBnbvsLDyD1PXDNxKJg==}
/@nx/nx-linux-arm64-gnu@16.7.2:
resolution: {integrity: sha512-+UdeFB1HY/3GU2+mflydFWpztghFRQiVzJV6MTcjtOzE3jfgXzz9TP580pDxozTvNSRPlblH07X+iB8DhVcB9w==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
......@@ -2926,8 +2926,8 @@ packages:
dev: true
optional: true
/@nx/nx-linux-arm64-musl@16.7.1:
resolution: {integrity: sha512-DiJ6Vpq9w2vaE9JgQs9M7K04QF75jAcqpuSlo25TYGU/GLiSZM6QpiAzsXhwZwFHfUjv0mL3iTmAcBmO1z9PBw==}
/@nx/nx-linux-arm64-musl@16.7.2:
resolution: {integrity: sha512-YfkWu+4GKXageuYiH5a77gIDAXnit5SIyfI+RWe/j04uFy171KnUt167DC417fv/fTGxeXY1tzOu112Y+x5ixw==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
......@@ -2935,8 +2935,8 @@ packages:
dev: true
optional: true
/@nx/nx-linux-x64-gnu@16.7.1:
resolution: {integrity: sha512-fc/2whXm4ao91LFQ5++2rgYeTIitQKXkfTrHLKLuMynou2Qd+jMUZVcVk+avaHVPKKu6ALbCUQ0YSTGdEfEx3Q==}
/@nx/nx-linux-x64-gnu@16.7.2:
resolution: {integrity: sha512-/TtSa2rHR+1gNuALR1yafl4fzBK2/GAhosf+skn00OgwsJ0c8ie9tuuftlMo+2n3LcXY/IaPDaD7t6fln4qsQg==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
......@@ -2944,8 +2944,8 @@ packages:
dev: true
optional: true
/@nx/nx-linux-x64-musl@16.7.1:
resolution: {integrity: sha512-3CzyUg5+/q83g/Pln71HPdkfjpU3dIBriiyuvJan8LwjKuhAdTFubAmu3CUp3ht1gZOdnwBQW1cdG1vx9EuBww==}
/@nx/nx-linux-x64-musl@16.7.2:
resolution: {integrity: sha512-VC638hxdWSA8VTDU9rAXjr60mmMP3ZyCUbSkJ+8ydEe83StMDY3PAXS5Hw3n/ouxDfCF9r1kWIGFe4g+emvfBw==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
......@@ -2953,8 +2953,8 @@ packages:
dev: true
optional: true
/@nx/nx-win32-arm64-msvc@16.7.1:
resolution: {integrity: sha512-1uhQGwWEa76jQyEVohcB4g4H5Wn4YNLx49eJe1SHLwMgbPZZZ5PgnSzwECu+I9E/ZCRaCJk2sHiuRGxDa29Dzg==}
/@nx/nx-win32-arm64-msvc@16.7.2:
resolution: {integrity: sha512-sSUqgANLgQFFzKTvyMczh5D6xiqTQnB8daJTLX+QUCv5vO5+ZSwuVDyNfr6g/HV2+ak0M9/wVQUae11TgUIPYw==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [win32]
......@@ -2962,8 +2962,8 @@ packages:
dev: true
optional: true
/@nx/nx-win32-x64-msvc@16.7.1:
resolution: {integrity: sha512-DLyME4yJKVhNTMgR3gDx7wVQ6ov6d9j2inGbTwoGoigMvzdaSqeoceMR5CSLOAeq9YBnH8FCbugTccg0iyZtvw==}
/@nx/nx-win32-x64-msvc@16.7.2:
resolution: {integrity: sha512-+n01cT9/P3o95x+FlRWYf9sFZ29ooxYD/WLcmxACeXN0V1bdbnZxKVSuJqrXZhmpHe7P+/+IRmniv9cdpkxz7g==}
engines: {node: '>= 10'}
cpu: [x64]
os: [win32]
......@@ -10904,7 +10904,7 @@ packages:
'@lerna/child-process': 7.1.5
'@lerna/create': 7.1.5
'@npmcli/run-script': 6.0.2
'@nx/devkit': 16.7.1(nx@16.7.1)
'@nx/devkit': 16.7.1(nx@16.7.2)
'@octokit/plugin-enterprise-rest': 6.0.1
'@octokit/rest': 19.0.11
byte-size: 8.1.1
......@@ -10947,7 +10947,7 @@ packages:
npm-packlist: 5.1.1
npm-registry-fetch: 14.0.5
npmlog: 6.0.2
nx: 16.7.1
nx: 16.7.2
p-map: 4.0.0
p-map-series: 2.1.0
p-pipe: 3.1.0
......@@ -12575,8 +12575,8 @@ packages:
- debug
dev: true
/nx@16.7.1:
resolution: {integrity: sha512-WdzUpoyPMjYyIwYyxiNqGc76HTked/5DiAdVPEjL9MbjNZVwtFE+aMmyf+qS6GV64yNBlUrQphABfP3GiCbuSQ==}
/nx@16.7.2:
resolution: {integrity: sha512-T7cRC97qJ4H9fg498ZGwFQaTzJdLQaRp6DFUwzFo1B9qzR56A2tA3HBvT/huo85THaDX+/pcgLyeixJKEE5RPg==}
hasBin: true
requiresBuild: true
peerDependencies:
......@@ -12588,7 +12588,7 @@ packages:
'@swc/core':
optional: true
dependencies:
'@nrwl/tao': 16.7.1
'@nrwl/tao': 16.7.2
'@parcel/watcher': 2.0.4
'@yarnpkg/lockfile': 1.1.0
'@yarnpkg/parsers': 3.0.0-rc.46
......@@ -12624,16 +12624,16 @@ packages:
yargs: 17.7.2
yargs-parser: 21.1.1
optionalDependencies:
'@nx/nx-darwin-arm64': 16.7.1
'@nx/nx-darwin-x64': 16.7.1
'@nx/nx-freebsd-x64': 16.7.1
'@nx/nx-linux-arm-gnueabihf': 16.7.1
'@nx/nx-linux-arm64-gnu': 16.7.1
'@nx/nx-linux-arm64-musl': 16.7.1
'@nx/nx-linux-x64-gnu': 16.7.1
'@nx/nx-linux-x64-musl': 16.7.1
'@nx/nx-win32-arm64-msvc': 16.7.1
'@nx/nx-win32-x64-msvc': 16.7.1
'@nx/nx-darwin-arm64': 16.7.2
'@nx/nx-darwin-x64': 16.7.2
'@nx/nx-freebsd-x64': 16.7.2
'@nx/nx-linux-arm-gnueabihf': 16.7.2
'@nx/nx-linux-arm64-gnu': 16.7.2
'@nx/nx-linux-arm64-musl': 16.7.2
'@nx/nx-linux-x64-gnu': 16.7.2
'@nx/nx-linux-x64-musl': 16.7.2
'@nx/nx-win32-arm64-msvc': 16.7.2
'@nx/nx-win32-x64-msvc': 16.7.2
transitivePeerDependencies:
- debug
dev: true
......
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