Documentation
¶
Index ¶
- Variables
- type API
- type APIBackend
- func (api *APIBackend) Active(_ context.Context) (bool, error)
- func (api *APIBackend) AddServerAsNonvoter(ctx context.Context, id string, addr string, version uint64) error
- func (api *APIBackend) AddServerAsVoter(ctx context.Context, id string, addr string, version uint64) error
- func (api *APIBackend) ClusterMembership(ctx context.Context) (*consensus.ClusterMembership, error)
- func (api *APIBackend) CommitUnsafePayload(ctx context.Context, payload *eth.ExecutionPayloadEnvelope) error
- func (api *APIBackend) Leader(ctx context.Context) (bool, error)
- func (api *APIBackend) LeaderOverridden(_ context.Context) (bool, error)
- func (api *APIBackend) LeaderWithID(ctx context.Context) (*consensus.ServerInfo, error)
- func (api *APIBackend) OverrideLeader(_ context.Context, override bool) error
- func (api *APIBackend) Pause(ctx context.Context) error
- func (api *APIBackend) Paused(ctx context.Context) (bool, error)
- func (api *APIBackend) RemoveServer(ctx context.Context, id string, version uint64) error
- func (api *APIBackend) Resume(ctx context.Context) error
- func (api *APIBackend) SequencerHealthy(ctx context.Context) (bool, error)
- func (api *APIBackend) Stop(ctx context.Context) error
- func (api *APIBackend) Stopped(ctx context.Context) (bool, error)
- func (api *APIBackend) TransferLeader(ctx context.Context) error
- func (api *APIBackend) TransferLeaderToServer(ctx context.Context, id string, addr string) error
- type APIClient
- func (c *APIClient) Active(ctx context.Context) (bool, error)
- func (c *APIClient) AddServerAsNonvoter(ctx context.Context, id string, addr string, version uint64) error
- func (c *APIClient) AddServerAsVoter(ctx context.Context, id string, addr string, version uint64) error
- func (c *APIClient) Close()
- func (c *APIClient) ClusterMembership(ctx context.Context) (*consensus.ClusterMembership, error)
- func (c *APIClient) CommitUnsafePayload(ctx context.Context, payload *eth.ExecutionPayloadEnvelope) error
- func (c *APIClient) Leader(ctx context.Context) (bool, error)
- func (c *APIClient) LeaderOverridden(ctx context.Context) (bool, error)
- func (c *APIClient) LeaderWithID(ctx context.Context) (*consensus.ServerInfo, error)
- func (c *APIClient) OverrideLeader(ctx context.Context, override bool) error
- func (c *APIClient) Pause(ctx context.Context) error
- func (c *APIClient) Paused(ctx context.Context) (bool, error)
- func (c *APIClient) RemoveServer(ctx context.Context, id string, version uint64) error
- func (c *APIClient) Resume(ctx context.Context) error
- func (c *APIClient) SequencerHealthy(ctx context.Context) (bool, error)
- func (c *APIClient) Stop(ctx context.Context) error
- func (c *APIClient) Stopped(ctx context.Context) (bool, error)
- func (c *APIClient) TransferLeader(ctx context.Context) error
- func (c *APIClient) TransferLeaderToServer(ctx context.Context, id string, addr string) error
- type ExecutionMinerProxyAPI
- type ExecutionMinerProxyBackend
- type ExecutionProxyAPI
- type ExecutionProxyBackend
- type NodeAdminProxyAPI
- type NodeAdminProxyBackend
- type NodeProxyAPI
- type NodeProxyBackend
Constants ¶
This section is empty.
Variables ¶
var ErrNotLeader = errors.New("refusing to proxy request to non-leader sequencer")
var ExecutionMinerRPCNamespace = "miner"
var ExecutionRPCNamespace = "eth"
var NodeAdminRPCNamespace = "admin"
var NodeRPCNamespace = "optimism"
var RPCNamespace = "conductor"
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { // OverrideLeader is used to override or clear override for the leader status. // It does not impact the actual raft consensus leadership status. It is supposed to be used when the cluster is unhealthy // and the node is the only one up, to allow batcher to be able to connect to the node, so that it could download blocks from the manually started sequencer. // override: true => force current conductor to be treated as leader regardless of the actual leadership status in raft. // override: false => clear the override, return the actual leadership status in raft. OverrideLeader(ctx context.Context, override bool) error // LeaderOverridden returns true if the leader status is overridden. LeaderOverridden(ctx context.Context) (bool, error) // Pause pauses op-conductor. Pause(ctx context.Context) error // Resume resumes op-conductor. Resume(ctx context.Context) error // Stop stops op-conductor. Stop(ctx context.Context) error // Paused returns true if op-conductor is paused. Paused(ctx context.Context) (bool, error) // Stopped returns true if op-conductor is stopped. Stopped(ctx context.Context) (bool, error) // SequencerHealthy returns true if the sequencer is healthy. SequencerHealthy(ctx context.Context) (bool, error) // Consensus related APIs // Leader returns true if the server is the leader. Leader(ctx context.Context) (bool, error) // LeaderWithID returns the current leader's server info. LeaderWithID(ctx context.Context) (*consensus.ServerInfo, error) // AddServerAsVoter adds a server as a voter to the cluster. AddServerAsVoter(ctx context.Context, id string, addr string, version uint64) error // AddServerAsNonvoter adds a server as a non-voter to the cluster. non-voter will not participate in leader election. AddServerAsNonvoter(ctx context.Context, id string, addr string, version uint64) error // RemoveServer removes a server from the cluster. RemoveServer(ctx context.Context, id string, version uint64) error // TransferLeader transfers leadership to another server. TransferLeader(ctx context.Context) error // TransferLeaderToServer transfers leadership to a specific server. TransferLeaderToServer(ctx context.Context, id string, addr string) error // ClusterMembership returns the current cluster membership configuration. ClusterMembership(ctx context.Context) (*consensus.ClusterMembership, error) // APIs called by op-node // Active returns true if op-conductor is active (not paused or stopped). Active(ctx context.Context) (bool, error) // CommitUnsafePayload commits an unsafe payload (latest head) to the consensus layer. CommitUnsafePayload(ctx context.Context, payload *eth.ExecutionPayloadEnvelope) error }
API defines the interface for the op-conductor API.
type APIBackend ¶
type APIBackend struct {
// contains filtered or unexported fields
}
APIBackend is the backend implementation of the API. TODO: (https://github.com/ethereum-optimism/protocol-quest/issues/45) Add metrics tracer here.
func NewAPIBackend ¶
func NewAPIBackend(log log.Logger, con conductor) *APIBackend
NewAPIBackend creates a new APIBackend instance.
func (*APIBackend) Active ¶
func (api *APIBackend) Active(_ context.Context) (bool, error)
Active implements API.
func (*APIBackend) AddServerAsNonvoter ¶
func (api *APIBackend) AddServerAsNonvoter(ctx context.Context, id string, addr string, version uint64) error
AddServerAsNonvoter implements API.
func (*APIBackend) AddServerAsVoter ¶
func (api *APIBackend) AddServerAsVoter(ctx context.Context, id string, addr string, version uint64) error
AddServerAsVoter implements API.
func (*APIBackend) ClusterMembership ¶ added in v1.7.0
func (api *APIBackend) ClusterMembership(ctx context.Context) (*consensus.ClusterMembership, error)
ClusterMembership implements API.
func (*APIBackend) CommitUnsafePayload ¶
func (api *APIBackend) CommitUnsafePayload(ctx context.Context, payload *eth.ExecutionPayloadEnvelope) error
CommitUnsafePayload implements API.
func (*APIBackend) Leader ¶
func (api *APIBackend) Leader(ctx context.Context) (bool, error)
Leader implements API, returns true if current conductor is leader of the cluster.
func (*APIBackend) LeaderOverridden ¶ added in v1.9.5
func (api *APIBackend) LeaderOverridden(_ context.Context) (bool, error)
LeaderOverridden implements API.
func (*APIBackend) LeaderWithID ¶
func (api *APIBackend) LeaderWithID(ctx context.Context) (*consensus.ServerInfo, error)
LeaderWithID implements API, returns the leader's server ID and address (not necessarily the current conductor).
func (*APIBackend) OverrideLeader ¶ added in v1.8.0
func (api *APIBackend) OverrideLeader(_ context.Context, override bool) error
OverrideLeader implements API.
func (*APIBackend) Pause ¶
func (api *APIBackend) Pause(ctx context.Context) error
Pause implements API.
func (*APIBackend) Paused ¶ added in v1.7.4
func (api *APIBackend) Paused(ctx context.Context) (bool, error)
Paused implements API.
func (*APIBackend) RemoveServer ¶
RemoveServer implements API.
func (*APIBackend) Resume ¶
func (api *APIBackend) Resume(ctx context.Context) error
Resume implements API.
func (*APIBackend) SequencerHealthy ¶
func (api *APIBackend) SequencerHealthy(ctx context.Context) (bool, error)
SequencerHealthy implements API.
func (*APIBackend) Stop ¶ added in v1.9.1
func (api *APIBackend) Stop(ctx context.Context) error
Stop implements API.
func (*APIBackend) Stopped ¶ added in v1.7.4
func (api *APIBackend) Stopped(ctx context.Context) (bool, error)
Stopped implements API.
func (*APIBackend) TransferLeader ¶
func (api *APIBackend) TransferLeader(ctx context.Context) error
TransferLeader implements API. With Raft implementation, a successful call does not mean that leadership transfer is complete It just means that leadership transfer is in progress (current leader has initiated a new leader election round and stepped down as leader)
func (*APIBackend) TransferLeaderToServer ¶
TransferLeaderToServer implements API. With Raft implementation, a successful call does not mean that leadership transfer is complete It just means that leadership transfer is in progress (current leader has initiated a new leader election round and stepped down as leader)
type APIClient ¶
type APIClient struct {
// contains filtered or unexported fields
}
APIClient provides a client for calling API methods.
func NewAPIClient ¶
NewAPIClient creates a new APIClient instance.
func (*APIClient) AddServerAsNonvoter ¶
func (c *APIClient) AddServerAsNonvoter(ctx context.Context, id string, addr string, version uint64) error
AddServerAsNonvoter implements API.
func (*APIClient) AddServerAsVoter ¶
func (c *APIClient) AddServerAsVoter(ctx context.Context, id string, addr string, version uint64) error
AddServerAsVoter implements API.
func (*APIClient) ClusterMembership ¶ added in v1.7.0
ClusterMembership implements API.
func (*APIClient) CommitUnsafePayload ¶
func (c *APIClient) CommitUnsafePayload(ctx context.Context, payload *eth.ExecutionPayloadEnvelope) error
CommitUnsafePayload implements API.
func (*APIClient) LeaderOverridden ¶ added in v1.9.5
LeaderOverridden implements API.
func (*APIClient) LeaderWithID ¶
LeaderWithID implements API.
func (*APIClient) OverrideLeader ¶ added in v1.8.0
OverrideLeader implements API.
func (*APIClient) RemoveServer ¶
RemoveServer implements API.
func (*APIClient) SequencerHealthy ¶
SequencerHealthy implements API.
func (*APIClient) TransferLeader ¶
TransferLeader implements API.
type ExecutionMinerProxyAPI ¶ added in v1.9.5
type ExecutionMinerProxyAPI interface {
SetMaxDASize(ctx context.Context, maxTxSize hexutil.Big, maxBlockSize hexutil.Big) bool
}
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 ExecutionMinerProxyBackend ¶ added in v1.9.5
type ExecutionMinerProxyBackend struct {
// contains filtered or unexported fields
}
ExecutionMinerProxyBackend implements an execution rpc proxy with a leadership check before each call.
func NewExecutionMinerProxyBackend ¶ added in v1.9.5
func NewExecutionMinerProxyBackend(log log.Logger, con conductor, client *ethclient.Client) *ExecutionMinerProxyBackend
func (*ExecutionMinerProxyBackend) SetMaxDASize ¶ added in v1.9.5
type ExecutionProxyAPI ¶
type ExecutionProxyAPI interface {
GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, fullTx bool) (map[string]interface{}, error)
}
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 ExecutionProxyBackend ¶
type ExecutionProxyBackend struct {
// contains filtered or unexported fields
}
ExecutionProxyBackend implements an execution rpc proxy with a leadership check before each call.
func NewExecutionProxyBackend ¶
func NewExecutionProxyBackend(log log.Logger, con conductor, client *ethclient.Client) *ExecutionProxyBackend
func (*ExecutionProxyBackend) GetBlockByNumber ¶
func (api *ExecutionProxyBackend) GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, fullTx bool) (map[string]interface{}, error)
type NodeAdminProxyAPI ¶
NodeAdminProxyAPI defines the methods proxied to the node 'admin_' rpc backend This should include all methods that are called by op-batcher or op-proposer
func NewNodeAdminProxyBackend ¶
func NewNodeAdminProxyBackend(log log.Logger, con conductor, client *sources.RollupClient) NodeAdminProxyAPI
NewNodeAdminProxyBackend creates a new NodeAdminProxyBackend instance.
type NodeAdminProxyBackend ¶
type NodeAdminProxyBackend struct {
// contains filtered or unexported fields
}
NodeAdminProxyAPI implements a node admin rpc proxy with a leadership check to make sure only leader returns the result.
func (*NodeAdminProxyBackend) SequencerActive ¶
func (api *NodeAdminProxyBackend) SequencerActive(ctx context.Context) (bool, error)
type NodeProxyAPI ¶
type NodeProxyAPI interface { OutputAtBlock(ctx context.Context, blockNumString string) (*eth.OutputResponse, error) SyncStatus(ctx context.Context) (*eth.SyncStatus, error) RollupConfig(ctx context.Context) (*rollup.Config, error) }
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 NodeProxyBackend ¶
type NodeProxyBackend struct {
// contains filtered or unexported fields
}
NodeProxyBackend implements a node rpc proxy with a leadership check before each call.
func NewNodeProxyBackend ¶
func NewNodeProxyBackend(log log.Logger, con conductor, client *sources.RollupClient) *NodeProxyBackend
func (*NodeProxyBackend) OutputAtBlock ¶
func (api *NodeProxyBackend) OutputAtBlock(ctx context.Context, blockNumString string) (*eth.OutputResponse, error)
func (*NodeProxyBackend) RollupConfig ¶
func (*NodeProxyBackend) SyncStatus ¶
func (api *NodeProxyBackend) SyncStatus(ctx context.Context) (*eth.SyncStatus, error)