Skip to content

Commit

Permalink
Merge pull request #5 from RSS3-Network/feat/bump-op
Browse files Browse the repository at this point in the history
bump op-geth
  • Loading branch information
anvztor authored Mar 28, 2024
2 parents 77e2101 + 29cebcb commit fc2c77c
Show file tree
Hide file tree
Showing 19 changed files with 15,454 additions and 48 deletions.
22 changes: 22 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,28 @@ jobs:
name: Tag
command: |
./.circleci/ci-docker-tag-op-geth-release.sh <<parameters.registry>>/<<parameters.repo>> $CIRCLE_TAG $CIRCLE_SHA1
- when:
condition:
equal: [optimism, << pipeline.git.branch >>]
steps:
- gcp-oidc-authenticate:
service_account_email: GCP_SERVICE_ATTESTOR_ACCOUNT_EMAIL
- run:
name: Sign
command: |
git clone --branch v1.0.3 --depth 1 https://github.com/ethereum-optimism/binary_signer
cd binary_signer/signer
IMAGE_PATH="<<parameters.registry>>/<<parameters.repo>>/<<parameters.docker_name>>:<<pipeline.git.revision>>"
echo $IMAGE_PATH
pip3 install -r requirements.txt
python3 ./sign_image.py --command="sign"\
--attestor-project-name="$ATTESTOR_PROJECT_NAME"\
--attestor-name="$ATTESTOR_NAME"\
--image-path="$IMAGE_PATH"\
--signer-logging-level="INFO"\
--attestor-key-id="//cloudkms.googleapis.com/v1/projects/$ATTESTOR_PROJECT_NAME/locations/global/keyRings/$ATTESTOR_NAME-key-ring/cryptoKeys/$ATTESTOR_NAME-key/cryptoKeyVersions/1"
build-geth:
Expand Down
23 changes: 1 addition & 22 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,22 +1 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.

accounts/usbwallet @karalabe
accounts/scwallet @gballet
accounts/abi @gballet @MariusVanDerWijden
cmd/clef @holiman
consensus @karalabe
core/ @karalabe @holiman @rjl493456442
eth/ @karalabe @holiman @rjl493456442
eth/catalyst/ @gballet
eth/tracers/ @s1na
graphql/ @s1na
les/ @zsfelfoldi @rjl493456442
light/ @zsfelfoldi @rjl493456442
node/ @fjl
p2p/ @fjl @zsfelfoldi
rpc/ @fjl @holiman
p2p/simulations @fjl
p2p/protocols @fjl
p2p/testing @fjl
signer/ @holiman
* @ethereum-optimism/op-geth-maintainers
10 changes: 9 additions & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -778,13 +778,14 @@ var (
Aliases: []string{"discv4"},
Usage: "Enables the V4 discovery mechanism",
Category: flags.NetworkingCategory,
Value: true,
Value: false,
}
DiscoveryV5Flag = &cli.BoolFlag{
Name: "discovery.v5",
Aliases: []string{"discv5"},
Usage: "Enables the experimental RLPx V5 (Topic Discovery) mechanism",
Category: flags.NetworkingCategory,
Value: true,
}
NetrestrictFlag = &cli.StringFlag{
Name: "netrestrict",
Expand Down Expand Up @@ -1122,6 +1123,13 @@ func setBootstrapNodesV5(ctx *cli.Context, cfg *p2p.Config) {
urls = SplitAndTrim(ctx.String(BootnodesFlag.Name))
case cfg.BootstrapNodesV5 != nil:
return // already set, don't apply defaults.
case ctx.IsSet(OPNetworkFlag.Name):
network := ctx.String(OPNetworkFlag.Name)
if strings.Contains(strings.ToLower(network), "mainnet") {
urls = params.V5OPBootnodes
} else {
urls = params.V5OPTestnetBootnodes
}
}

cfg.BootstrapNodesV5 = make([]*enode.Node, 0, len(urls))
Expand Down
7 changes: 6 additions & 1 deletion core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,13 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, triedb *trie.Database, gen
// state database is not initialized yet. It can happen that the node
// is initialized with an external ancient store. Commit genesis state
// in this case.
// If the bedrock block is not 0, that implies that the network was migrated at the bedrock block.
// In this case the genesis state may not be in the state database (e.g. op-geth is performing a snap
// sync without an existing datadir) & even if it were, would not be useful as op-geth is not able to
// execute the pre-bedrock STF.
header := rawdb.ReadHeader(db, stored, 0)
if header.Root != types.EmptyRootHash && !triedb.Initialized(header.Root) {
transitionedNetwork := genesis != nil && genesis.Config != nil && genesis.Config.BedrockBlock != nil && genesis.Config.BedrockBlock.Uint64() != 0
if header.Root != types.EmptyRootHash && !triedb.Initialized(header.Root) && !transitionedNetwork {
if genesis == nil {
genesis = DefaultGenesisBlock()
}
Expand Down
6 changes: 5 additions & 1 deletion core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,11 @@ func (st *StateTransition) innerTransitionDb() (*ExecutionResult, error) {
if tracer := st.evm.Config.Tracer; tracer != nil {
tracer.CaptureTxStart(st.initialGas)
defer func() {
tracer.CaptureTxEnd(st.gasRemaining)
if st.msg.IsDepositTx {
tracer.CaptureTxEnd(0)
} else {
tracer.CaptureTxEnd(st.gasRemaining)
}
}()
}

Expand Down
2 changes: 1 addition & 1 deletion core/vm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (evm *EVM) precompile(addr common.Address) (PrecompiledContract, bool) {
p, ok := precompiles[addr]
// Restrict overrides to known precompiles
if ok && evm.chainConfig.IsOptimism() && evm.Config.OptimismPrecompileOverrides != nil {
override, ok := evm.Config.OptimismPrecompileOverrides(evm.chainRules, addr)
override, ok := evm.Config.OptimismPrecompileOverrides(evm.chainRules, p, addr)
if ok {
return override, ok
}
Expand Down
2 changes: 1 addition & 1 deletion core/vm/interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
)

// PrecompileOverrides is a function that can be used to override the default precompiled contracts
type PrecompileOverrides func(params.Rules, common.Address) (PrecompiledContract, bool)
type PrecompileOverrides func(params.Rules, PrecompiledContract, common.Address) (PrecompiledContract, bool)

// Config are the configuration options for the Interpreter
type Config struct {
Expand Down
3 changes: 1 addition & 2 deletions eth/tracers/internal/tracetest/flat_calltrace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/tests"

// Force-load the native, to trigger registration
Expand Down Expand Up @@ -82,7 +81,7 @@ func flatCallTracerTestRunner(tracerName string, filename string, dirPath string
}
// Configure a blockchain with the given prestate
tx := new(types.Transaction)
if err := rlp.DecodeBytes(common.FromHex(test.Input), tx); err != nil {
if err := tx.UnmarshalBinary(common.FromHex(test.Input)); err != nil {
return fmt.Errorf("failed to parse testcase input: %v", err)
}
signer := types.MakeSigner(test.Genesis.Config, new(big.Int).SetUint64(uint64(test.Context.Number)), uint64(test.Context.Time))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"context": {
"difficulty": "3699098917",
"gasLimit": "5258985",
"miner": "0xd049bfd667cb46aa3ef5df0da3e57db3be39e511",
"number": "2294631",
"timestamp": "1513675366"
},
"genesis": {
"alloc": {},
"config": {
"chainId": 3,
"daoForkSupport": true,
"eip150Hash": "0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d",
"ethash": {},
"eip150Block": 0,
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"berlinBlock": 0,
"londonBlock": 0
},
"difficulty": "3699098917",
"extraData": "0x4554482e45544846414e532e4f52472d4641313738394444",
"gasLimit": "5263953",
"hash": "0x03a0f62a8106793dafcfae7b75fd2654322062d585a19cea568314d7205790dc",
"miner": "0xbbf5029fd710d227630c8b7d338051b8e76d50b3",
"mixHash": "0x15482cc64b7c00a947f5bf015dfc010db1a6a668c74df61974d6a7848c174408",
"nonce": "0xd1bdb150f6fd170e",
"number": "2294630",
"stateRoot": "0x1ab1a534e84cc787cda1db21e0d5920ab06017948075b759166cfea7274657a1",
"timestamp": "1513675347",
"totalDifficulty": "7160543502214733"
},
"input": "0x7ef85aa0b4f9f798a5fe956d1b79c3eff355febf9e1039a7440948845536982cb62aa03194bc339e628e6fe32c39e84392d087567b2743ea3594bc339e628e6fe32c39e84392d087567b2743ea3580871aa535d3d0c00083030d408000",
"result": {
"from":"0x0000000000000000000000000000000000000000",
"gas":"0x0",
"gasUsed":"0x30d40",
"input":"0x",
"error": "failed deposit transaction",
"type":"STOP"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"context": {
"difficulty": "3699098917",
"gasLimit": "5258985",
"miner": "0xd049bfd667cb46aa3ef5df0da3e57db3be39e511",
"number": "2294631",
"timestamp": "1513675366"
},
"genesis": {
"alloc": {},
"config": {
"chainId": 3,
"daoForkSupport": true,
"eip150Hash": "0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d",
"ethash": {},
"eip150Block": 0,
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"berlinBlock": 0,
"londonBlock": 0
},
"difficulty": "3699098917",
"extraData": "0x4554482e45544846414e532e4f52472d4641313738394444",
"gasLimit": "5263953",
"hash": "0x03a0f62a8106793dafcfae7b75fd2654322062d585a19cea568314d7205790dc",
"miner": "0xbbf5029fd710d227630c8b7d338051b8e76d50b3",
"mixHash": "0x15482cc64b7c00a947f5bf015dfc010db1a6a668c74df61974d6a7848c174408",
"nonce": "0xd1bdb150f6fd170e",
"number": "2294630",
"stateRoot": "0x1ab1a534e84cc787cda1db21e0d5920ab06017948075b759166cfea7274657a1",
"timestamp": "1513675347",
"totalDifficulty": "7160543502214733"
},
"input": "0x7ef85aa0b4f9f798a5fe956d1b79c3eff355febf9e1039a7440948845536982cb62aa03194bc339e628e6fe32c39e84392d087567b2743ea3594bc339e628e6fe32c39e84392d087567b2743ea3580871aa535d3d0c00083030d408000",
"result": [
{
"action": {
"callType": "stop",
"from": "0x0000000000000000000000000000000000000000",
"gas": "0x0",
"input": "0x",
"value": "0x0"
},
"blockNumber": 0,
"error": "failed deposit transaction",
"result": {
"gasUsed": "0x0",
"output": "0x"
},
"subtraces": 0,
"traceAddress": [],
"type": "call"
}
]
}
4 changes: 4 additions & 0 deletions eth/tracers/native/call.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ func (t *callTracer) GetResult() (json.RawMessage, error) {
return nil, errors.New("incorrect number of top-level calls")
}

if t.callstack[0].Type == vm.STOP {
t.callstack[0].Error = "failed deposit transaction"
}

res, err := json.Marshal(t.callstack[0])
if err != nil {
return nil, err
Expand Down
6 changes: 5 additions & 1 deletion eth/tracers/native/call_flat.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ func (t *flatCallTracer) GetResult() (json.RawMessage, error) {
return nil, errors.New("invalid number of calls")
}

if t.tracer.callstack[0].Type == vm.STOP {
t.tracer.callstack[0].Error = "failed deposit transaction"
}

flat, err := flatFromNested(&t.tracer.callstack[0], []int{}, t.config.ConvertParityErrors, t.ctx)
if err != nil {
return nil, err
Expand Down Expand Up @@ -249,7 +253,7 @@ func flatFromNested(input *callFrame, traceAddress []int, convertErrs bool, ctx
frame = newFlatCreate(input)
case vm.SELFDESTRUCT:
frame = newFlatSelfdestruct(input)
case vm.CALL, vm.STATICCALL, vm.CALLCODE, vm.DELEGATECALL:
case vm.CALL, vm.STATICCALL, vm.CALLCODE, vm.DELEGATECALL, vm.STOP:
frame = newFlatCall(input)
default:
return nil, fmt.Errorf("unrecognized call frame type: %s", input.Type)
Expand Down
2 changes: 1 addition & 1 deletion fork.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -262,4 +262,4 @@ ignore:
- "*.sum"
- "go.mod"
- "fork.yaml"
- ".github/workflows/*"
- ".github/*"
Loading

0 comments on commit fc2c77c

Please sign in to comment.