Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
55f217d5
Unverified
Commit
55f217d5
authored
Oct 20, 2023
by
protolambda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-service,op-node,op-program: default to new standard rpc-kind with eth_getBlockReceipts support
parent
7591f192
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
35 additions
and
18 deletions
+35
-18
l1_replica.go
op-e2e/actions/l1_replica.go
+1
-1
l1_replica_test.go
op-e2e/actions/l1_replica_test.go
+1
-1
l2_sequencer_test.go
op-e2e/actions/l2_sequencer_test.go
+1
-1
reorg_test.go
op-e2e/actions/reorg_test.go
+2
-2
setup.go
op-e2e/setup.go
+1
-1
flags.go
op-node/flags/flags.go
+1
-1
main_test.go
op-program/host/cmd/main_test.go
+1
-1
config.go
op-program/host/config/config.go
+1
-1
flags.go
op-program/host/flags/flags.go
+1
-1
eth_client_test.go
op-service/sources/eth_client_test.go
+4
-4
l2_client.go
op-service/sources/l2_client.go
+1
-1
receipts.go
op-service/sources/receipts.go
+10
-3
receipts_test.go
op-service/sources/receipts_test.go
+10
-0
No files found.
op-e2e/actions/l1_replica.go
View file @
55f217d5
...
...
@@ -180,7 +180,7 @@ func (s *L1Replica) RPCClient() client.RPC {
}
func
(
s
*
L1Replica
)
L1Client
(
t
Testing
,
cfg
*
rollup
.
Config
)
*
sources
.
L1Client
{
l1F
,
err
:=
sources
.
NewL1Client
(
s
.
RPCClient
(),
s
.
log
,
nil
,
sources
.
L1ClientDefaultConfig
(
cfg
,
false
,
sources
.
RPCKind
Basic
))
l1F
,
err
:=
sources
.
NewL1Client
(
s
.
RPCClient
(),
s
.
log
,
nil
,
sources
.
L1ClientDefaultConfig
(
cfg
,
false
,
sources
.
RPCKind
Standard
))
require
.
NoError
(
t
,
err
)
return
l1F
}
...
...
op-e2e/actions/l1_replica_test.go
View file @
55f217d5
...
...
@@ -42,7 +42,7 @@ func TestL1Replica_ActL1RPCFail(gt *testing.T) {
// mock an RPC failure
replica
.
ActL1RPCFail
(
t
)
// check RPC failure
l1Cl
,
err
:=
sources
.
NewL1Client
(
replica
.
RPCClient
(),
log
,
nil
,
sources
.
L1ClientDefaultConfig
(
sd
.
RollupCfg
,
false
,
sources
.
RPCKind
Basic
))
l1Cl
,
err
:=
sources
.
NewL1Client
(
replica
.
RPCClient
(),
log
,
nil
,
sources
.
L1ClientDefaultConfig
(
sd
.
RollupCfg
,
false
,
sources
.
RPCKind
Standard
))
require
.
NoError
(
t
,
err
)
_
,
err
=
l1Cl
.
InfoByLabel
(
t
.
Ctx
(),
eth
.
Unsafe
)
require
.
ErrorContains
(
t
,
err
,
"mock"
)
...
...
op-e2e/actions/l2_sequencer_test.go
View file @
55f217d5
...
...
@@ -21,7 +21,7 @@ func setupSequencerTest(t Testing, sd *e2eutils.SetupData, log log.Logger) (*L1M
miner
:=
NewL1Miner
(
t
,
log
,
sd
.
L1Cfg
)
l1F
,
err
:=
sources
.
NewL1Client
(
miner
.
RPCClient
(),
log
,
nil
,
sources
.
L1ClientDefaultConfig
(
sd
.
RollupCfg
,
false
,
sources
.
RPCKind
Basic
))
l1F
,
err
:=
sources
.
NewL1Client
(
miner
.
RPCClient
(),
log
,
nil
,
sources
.
L1ClientDefaultConfig
(
sd
.
RollupCfg
,
false
,
sources
.
RPCKind
Standard
))
require
.
NoError
(
t
,
err
)
engine
:=
NewL2Engine
(
t
,
log
,
sd
.
L2Cfg
,
sd
.
RollupCfg
.
Genesis
.
L1
,
jwtPath
)
l2Cl
,
err
:=
sources
.
NewEngineClient
(
engine
.
RPCClient
(),
log
,
nil
,
sources
.
EngineClientDefaultConfig
(
sd
.
RollupCfg
))
...
...
op-e2e/actions/reorg_test.go
View file @
55f217d5
...
...
@@ -572,7 +572,7 @@ func TestRestartOpGeth(gt *testing.T) {
jwtPath
:=
e2eutils
.
WriteDefaultJWT
(
t
)
// L1
miner
:=
NewL1Miner
(
t
,
log
,
sd
.
L1Cfg
)
l1F
,
err
:=
sources
.
NewL1Client
(
miner
.
RPCClient
(),
log
,
nil
,
sources
.
L1ClientDefaultConfig
(
sd
.
RollupCfg
,
false
,
sources
.
RPCKind
Basic
))
l1F
,
err
:=
sources
.
NewL1Client
(
miner
.
RPCClient
(),
log
,
nil
,
sources
.
L1ClientDefaultConfig
(
sd
.
RollupCfg
,
false
,
sources
.
RPCKind
Standard
))
require
.
NoError
(
t
,
err
)
// Sequencer
seqEng
:=
NewL2Engine
(
t
,
log
,
sd
.
L2Cfg
,
sd
.
RollupCfg
.
Genesis
.
L1
,
jwtPath
,
dbOption
)
...
...
@@ -667,7 +667,7 @@ func TestConflictingL2Blocks(gt *testing.T) {
altSeqEng
:=
NewL2Engine
(
t
,
log
,
sd
.
L2Cfg
,
sd
.
RollupCfg
.
Genesis
.
L1
,
jwtPath
)
altSeqEngCl
,
err
:=
sources
.
NewEngineClient
(
altSeqEng
.
RPCClient
(),
log
,
nil
,
sources
.
EngineClientDefaultConfig
(
sd
.
RollupCfg
))
require
.
NoError
(
t
,
err
)
l1F
,
err
:=
sources
.
NewL1Client
(
miner
.
RPCClient
(),
log
,
nil
,
sources
.
L1ClientDefaultConfig
(
sd
.
RollupCfg
,
false
,
sources
.
RPCKind
Basic
))
l1F
,
err
:=
sources
.
NewL1Client
(
miner
.
RPCClient
(),
log
,
nil
,
sources
.
L1ClientDefaultConfig
(
sd
.
RollupCfg
,
false
,
sources
.
RPCKind
Standard
))
require
.
NoError
(
t
,
err
)
altSequencer
:=
NewL2Sequencer
(
t
,
log
,
l1F
,
altSeqEngCl
,
sd
.
RollupCfg
,
0
)
altBatcher
:=
NewL2Batcher
(
log
,
sd
.
RollupCfg
,
&
BatcherCfg
{
...
...
op-e2e/setup.go
View file @
55f217d5
...
...
@@ -775,7 +775,7 @@ func configureL1(rollupNodeCfg *rollupNode.Config, l1Node EthInstance) {
rollupNodeCfg
.
L1
=
&
rollupNode
.
L1EndpointConfig
{
L1NodeAddr
:
l1EndpointConfig
,
L1TrustRPC
:
false
,
L1RPCKind
:
sources
.
RPCKind
Basic
,
L1RPCKind
:
sources
.
RPCKind
Standard
,
RateLimit
:
0
,
BatchSize
:
20
,
HttpPollInterval
:
time
.
Millisecond
*
100
,
...
...
op-node/flags/flags.go
View file @
55f217d5
...
...
@@ -78,7 +78,7 @@ var (
openum
.
EnumString
(
sources
.
RPCProviderKinds
),
EnvVars
:
prefixEnvVars
(
"L1_RPC_KIND"
),
Value
:
func
()
*
sources
.
RPCProviderKind
{
out
:=
sources
.
RPCKind
Basic
out
:=
sources
.
RPCKind
Standard
return
&
out
}(),
}
...
...
op-program/host/cmd/main_test.go
View file @
55f217d5
...
...
@@ -210,7 +210,7 @@ func TestL1TrustRPC(t *testing.T) {
func
TestL1RPCKind
(
t
*
testing
.
T
)
{
t
.
Run
(
"DefaultBasic"
,
func
(
t
*
testing
.
T
)
{
cfg
:=
configForArgs
(
t
,
addRequiredArgs
())
require
.
Equal
(
t
,
sources
.
RPCKind
Basic
,
cfg
.
L1RPCKind
)
require
.
Equal
(
t
,
sources
.
RPCKind
Standard
,
cfg
.
L1RPCKind
)
})
for
_
,
kind
:=
range
sources
.
RPCProviderKinds
{
t
.
Run
(
kind
.
String
(),
func
(
t
*
testing
.
T
)
{
...
...
op-program/host/config/config.go
View file @
55f217d5
...
...
@@ -130,7 +130,7 @@ func NewConfig(
L2OutputRoot
:
l2OutputRoot
,
L2Claim
:
l2Claim
,
L2ClaimBlockNumber
:
l2ClaimBlockNum
,
L1RPCKind
:
sources
.
RPCKind
Basic
,
L1RPCKind
:
sources
.
RPCKind
Standard
,
IsCustomChainConfig
:
isCustomConfig
,
}
}
...
...
op-program/host/flags/flags.go
View file @
55f217d5
...
...
@@ -86,7 +86,7 @@ var (
openum
.
EnumString
(
sources
.
RPCProviderKinds
),
EnvVars
:
prefixEnvVars
(
"L1_RPC_KIND"
),
Value
:
func
()
*
sources
.
RPCProviderKind
{
out
:=
sources
.
RPCKind
Basic
out
:=
sources
.
RPCKind
Standard
return
&
out
}(),
}
...
...
op-service/sources/eth_client_test.go
View file @
55f217d5
...
...
@@ -52,7 +52,7 @@ var testEthClientConfig = &EthClientConfig{
MaxConcurrentRequests
:
10
,
TrustRPC
:
false
,
MustBePostMerge
:
false
,
RPCProviderKind
:
RPCKind
Basic
,
RPCProviderKind
:
RPCKind
Standard
,
}
func
randHash
()
(
out
common
.
Hash
)
{
...
...
@@ -133,7 +133,7 @@ func TestEthClient_InfoByNumber(t *testing.T) {
"eth_getBlockByNumber"
,
[]
any
{
n
.
String
(),
false
})
.
Run
(
func
(
args
mock
.
Arguments
)
{
*
args
[
1
]
.
(
**
rpcHeader
)
=
rhdr
})
.
Return
([]
error
{
nil
})
s
,
err
:=
NewL1Client
(
m
,
nil
,
nil
,
L1ClientDefaultConfig
(
&
rollup
.
Config
{
SeqWindowSize
:
10
},
true
,
RPCKind
Basic
))
s
,
err
:=
NewL1Client
(
m
,
nil
,
nil
,
L1ClientDefaultConfig
(
&
rollup
.
Config
{
SeqWindowSize
:
10
},
true
,
RPCKind
Standard
))
require
.
NoError
(
t
,
err
)
info
,
err
:=
s
.
InfoByNumber
(
ctx
,
uint64
(
n
))
require
.
NoError
(
t
,
err
)
...
...
@@ -152,7 +152,7 @@ func TestEthClient_WrongInfoByNumber(t *testing.T) {
"eth_getBlockByNumber"
,
[]
any
{
n
.
String
(),
false
})
.
Run
(
func
(
args
mock
.
Arguments
)
{
*
args
[
1
]
.
(
**
rpcHeader
)
=
&
rhdr2
})
.
Return
([]
error
{
nil
})
s
,
err
:=
NewL1Client
(
m
,
nil
,
nil
,
L1ClientDefaultConfig
(
&
rollup
.
Config
{
SeqWindowSize
:
10
},
true
,
RPCKind
Basic
))
s
,
err
:=
NewL1Client
(
m
,
nil
,
nil
,
L1ClientDefaultConfig
(
&
rollup
.
Config
{
SeqWindowSize
:
10
},
true
,
RPCKind
Standard
))
require
.
NoError
(
t
,
err
)
_
,
err
=
s
.
InfoByNumber
(
ctx
,
uint64
(
n
))
require
.
Error
(
t
,
err
,
"cannot accept the wrong block"
)
...
...
@@ -171,7 +171,7 @@ func TestEthClient_WrongInfoByHash(t *testing.T) {
"eth_getBlockByHash"
,
[]
any
{
k
,
false
})
.
Run
(
func
(
args
mock
.
Arguments
)
{
*
args
[
1
]
.
(
**
rpcHeader
)
=
&
rhdr2
})
.
Return
([]
error
{
nil
})
s
,
err
:=
NewL1Client
(
m
,
nil
,
nil
,
L1ClientDefaultConfig
(
&
rollup
.
Config
{
SeqWindowSize
:
10
},
true
,
RPCKind
Basic
))
s
,
err
:=
NewL1Client
(
m
,
nil
,
nil
,
L1ClientDefaultConfig
(
&
rollup
.
Config
{
SeqWindowSize
:
10
},
true
,
RPCKind
Standard
))
require
.
NoError
(
t
,
err
)
_
,
err
=
s
.
InfoByHash
(
ctx
,
k
)
require
.
Error
(
t
,
err
,
"cannot accept the wrong block"
)
...
...
op-service/sources/l2_client.go
View file @
55f217d5
...
...
@@ -51,7 +51,7 @@ func L2ClientDefaultConfig(config *rollup.Config, trustRPC bool) *L2ClientConfig
MaxConcurrentRequests
:
10
,
TrustRPC
:
trustRPC
,
MustBePostMerge
:
true
,
RPCProviderKind
:
RPCKind
Basic
,
RPCProviderKind
:
RPCKind
Standard
,
MethodResetDuration
:
time
.
Minute
,
},
// Not bounded by span, to cover find-sync-start range fully for speedy recovery after errors.
...
...
op-service/sources/receipts.go
View file @
55f217d5
...
...
@@ -121,8 +121,9 @@ const (
RPCKindNethermind
RPCProviderKind
=
"nethermind"
RPCKindDebugGeth
RPCProviderKind
=
"debug_geth"
RPCKindErigon
RPCProviderKind
=
"erigon"
RPCKindBasic
RPCProviderKind
=
"basic"
// try only the standard most basic receipt fetching
RPCKindAny
RPCProviderKind
=
"any"
// try any method available
RPCKindBasic
RPCProviderKind
=
"basic"
// try only the standard most basic receipt fetching
RPCKindAny
RPCProviderKind
=
"any"
// try any method available
RPCKindStandard
RPCProviderKind
=
"standard"
// try standard methods, including newer optimized standard RPC methods
)
var
RPCProviderKinds
=
[]
RPCProviderKind
{
...
...
@@ -135,6 +136,7 @@ var RPCProviderKinds = []RPCProviderKind{
RPCKindErigon
,
RPCKindBasic
,
RPCKindAny
,
RPCKindStandard
,
}
func
(
kind
RPCProviderKind
)
String
()
string
{
...
...
@@ -235,11 +237,14 @@ const (
// - Alchemy: https://docs.alchemy.com/reference/eth-getblockreceipts
// - Nethermind: https://docs.nethermind.io/nethermind/ethereum-client/json-rpc/parity#parity_getblockreceipts
ParityGetBlockReceipts
// EthGetBlockReceipts is a non-standard receipt fetching method in the eth namespace,
// EthGetBlockReceipts is a
previously
non-standard receipt fetching method in the eth namespace,
// supported by some RPC platforms.
// This since has been standardized in https://github.com/ethereum/execution-apis/pull/438 and adopted in Geth:
// https://github.com/ethereum/go-ethereum/pull/27702
// Available in:
// - Alchemy: 500 CU total (and deprecated)
// - QuickNode: 59 credits total (does not seem to work with block hash arg, inaccurate docs)
// - Standard, incl. Geth, Besu and Reth, and Nethermind has a PR in review.
// Method: eth_getBlockReceipts
// Params:
// - QuickNode: string, "quantity or tag", docs say incl. block hash, but API does not actually accept it.
...
...
@@ -296,6 +301,8 @@ func AvailableReceiptsFetchingMethods(kind RPCProviderKind) ReceiptsFetchingMeth
return
AlchemyGetTransactionReceipts
|
EthGetBlockReceipts
|
DebugGetRawReceipts
|
ErigonGetBlockReceiptsByBlockHash
|
ParityGetBlockReceipts
|
EthGetTransactionReceiptBatch
case
RPCKindStandard
:
return
EthGetBlockReceipts
|
EthGetTransactionReceiptBatch
default
:
return
EthGetTransactionReceiptBatch
}
...
...
op-service/sources/receipts_test.go
View file @
55f217d5
...
...
@@ -305,6 +305,16 @@ func TestEthClient_FetchReceipts(t *testing.T) {
providerKind
:
RPCKindBasic
,
setup
:
fallbackCase
(
4
,
EthGetTransactionReceiptBatch
),
},
{
name
:
"standard"
,
providerKind
:
RPCKindStandard
,
setup
:
fallbackCase
(
4
,
EthGetBlockReceipts
),
},
{
name
:
"standard fallback"
,
providerKind
:
RPCKindStandard
,
setup
:
fallbackCase
(
4
,
EthGetBlockReceipts
,
EthGetTransactionReceiptBatch
),
},
{
name
:
"any discovers alchemy"
,
providerKind
:
RPCKindAny
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment