-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
op-conductor: adds miner_setMaxDASize to conductor execution proxy
- Loading branch information
Showing
4 changed files
with
68 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters