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
0ff55dde
Unverified
Commit
0ff55dde
authored
Nov 07, 2024
by
Zach Howard
Committed by
GitHub
Nov 07, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-conductor: adds miner_setMaxDASize to conductor execution proxy (#12869)
parent
63b4af70
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
3 deletions
+55
-3
service.go
op-conductor/conductor/service.go
+5
-0
api.go
op-conductor/rpc/api.go
+10
-3
excecution_miner_proxy.go
op-conductor/rpc/excecution_miner_proxy.go
+40
-0
No files found.
op-conductor/conductor/service.go
View file @
0ff55dde
...
...
@@ -247,6 +247,11 @@ func (oc *OpConductor) initRPCServer(ctx context.Context) error {
Namespace
:
conductorrpc
.
ExecutionRPCNamespace
,
Service
:
executionProxy
,
})
execMinerProxy
:=
conductorrpc
.
NewExecutionMinerProxyBackend
(
oc
.
log
,
oc
,
execClient
)
server
.
AddAPI
(
rpc
.
API
{
Namespace
:
conductorrpc
.
ExecutionMinerRPCNamespace
,
Service
:
execMinerProxy
,
})
nodeClient
,
err
:=
dial
.
DialRollupClientWithTimeout
(
ctx
,
1
*
time
.
Minute
,
oc
.
log
,
oc
.
cfg
.
NodeRPC
)
if
err
!=
nil
{
...
...
op-conductor/rpc/api.go
View file @
0ff55dde
...
...
@@ -4,6 +4,7 @@ import (
"context"
"errors"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum-optimism/optimism/op-conductor/consensus"
...
...
@@ -61,13 +62,19 @@ type API interface {
CommitUnsafePayload
(
ctx
context
.
Context
,
payload
*
eth
.
ExecutionPayloadEnvelope
)
error
}
// ExecutionProxyAPI defines the methods proxied to the execution rpc backend
// ExecutionProxyAPI defines the methods proxied to the execution
'eth_'
rpc backend
// This should include all methods that are called by op-batcher or op-proposer
type
ExecutionProxyAPI
interface
{
GetBlockByNumber
(
ctx
context
.
Context
,
number
rpc
.
BlockNumber
,
fullTx
bool
)
(
map
[
string
]
interface
{},
error
)
}
// NodeProxyAPI defines the methods proxied to the node rpc backend
// ExecutionMinerProxyAPI defines the methods proxied to the execution 'miner_' rpc backend
// This should include all methods that are called by op-batcher or op-proposer
type
ExecutionMinerProxyAPI
interface
{
SetMaxDASize
(
ctx
context
.
Context
,
maxTxSize
hexutil
.
Big
,
maxBlockSize
hexutil
.
Big
)
bool
}
// NodeProxyAPI defines the methods proxied to the node 'optimism_' rpc backend
// This should include all methods that are called by op-batcher or op-proposer
type
NodeProxyAPI
interface
{
OutputAtBlock
(
ctx
context
.
Context
,
blockNumString
string
)
(
*
eth
.
OutputResponse
,
error
)
...
...
@@ -75,7 +82,7 @@ type NodeProxyAPI interface {
RollupConfig
(
ctx
context
.
Context
)
(
*
rollup
.
Config
,
error
)
}
// Node
ProxyAPI defines the methods proxied to the node
rpc backend
// Node
AdminProxyAPI defines the methods proxied to the node 'admin_'
rpc backend
// This should include all methods that are called by op-batcher or op-proposer
type
NodeAdminProxyAPI
interface
{
SequencerActive
(
ctx
context
.
Context
)
(
bool
,
error
)
...
...
op-conductor/rpc/excecution_miner_proxy.go
0 → 100644
View file @
0ff55dde
package
rpc
import
(
"context"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log"
)
var
ExecutionMinerRPCNamespace
=
"miner"
// ExecutionMinerProxyBackend implements an execution rpc proxy with a leadership check before each call.
type
ExecutionMinerProxyBackend
struct
{
log
log
.
Logger
con
conductor
client
*
ethclient
.
Client
}
var
_
ExecutionMinerProxyAPI
=
(
*
ExecutionMinerProxyBackend
)(
nil
)
func
NewExecutionMinerProxyBackend
(
log
log
.
Logger
,
con
conductor
,
client
*
ethclient
.
Client
)
*
ExecutionMinerProxyBackend
{
return
&
ExecutionMinerProxyBackend
{
log
:
log
,
con
:
con
,
client
:
client
,
}
}
func
(
api
*
ExecutionMinerProxyBackend
)
SetMaxDASize
(
ctx
context
.
Context
,
maxTxSize
hexutil
.
Big
,
maxBlockSize
hexutil
.
Big
)
bool
{
var
result
bool
if
!
api
.
con
.
Leader
(
ctx
)
{
return
false
}
err
:=
api
.
client
.
Client
()
.
Call
(
&
result
,
"miner_setMaxDASize"
,
maxTxSize
,
maxBlockSize
)
if
err
!=
nil
{
return
false
}
return
result
}
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