Documentation ¶
Index ¶
- Variables
- func NewAdminAPI(dr driverClient, m rpcMetrics) *adminAPI
- func NewNodeAPI(config *rollup.Config, l2Client l2EthClient, dr driverClient, log log.Logger, ...) *nodeAPI
- type Config
- type HeartbeatConfig
- type L1EndpointConfig
- type L1EndpointSetup
- type L2EndpointConfig
- type L2EndpointSetup
- type LogConfig
- type MetricsConfig
- type OpNode
- func (n *OpNode) Close() error
- func (n *OpNode) HTTPEndpoint() string
- func (n *OpNode) ListenAddr() string
- func (n *OpNode) OnNewL1Finalized(ctx context.Context, sig eth.L1BlockRef)
- func (n *OpNode) OnNewL1Head(ctx context.Context, sig eth.L1BlockRef)
- func (n *OpNode) OnNewL1Safe(ctx context.Context, sig eth.L1BlockRef)
- func (n *OpNode) OnUnsafeL2Payload(ctx context.Context, from peer.ID, payload *eth.ExecutionPayload) error
- func (n *OpNode) P2P() p2p.Node
- func (n *OpNode) PublishL2Payload(ctx context.Context, payload *eth.ExecutionPayload) error
- func (n *OpNode) Start(ctx context.Context) error
- type PreparedL1Endpoint
- type PreparedL2Endpoints
- type RPCConfig
- type RuntimeCfgL1Source
- type RuntimeConfig
- type Tracer
Constants ¶
This section is empty.
Variables ¶
var ( // UnsafeBlockSignerAddressSystemConfigStorageSlot is the storage slot identifier of the unsafeBlockSigner // `address` storage value in the SystemConfig L1 contract. Computed as `keccak256("systemconfig.unsafeblocksigner")` UnsafeBlockSignerAddressSystemConfigStorageSlot = common.HexToHash("0x65a7ed542fb37fe237fdfbdd70b31598523fe5b32879e307bae27a0bd9581c08") )
Functions ¶
func NewAdminAPI ¶
func NewAdminAPI(dr driverClient, m rpcMetrics) *adminAPI
Types ¶
type Config ¶
type Config struct { L1 L1EndpointSetup L2 L2EndpointSetup Driver driver.Config Rollup rollup.Config // P2PSigner will be used for signing off on published content // if the node is sequencing and if the p2p stack is enabled P2PSigner p2p.SignerSetup RPC RPCConfig P2P p2p.SetupP2P Metrics MetricsConfig Pprof oppprof.CLIConfig // Used to poll the L1 for new finalized or safe blocks L1EpochPollInterval time.Duration // Optional Tracer Tracer Heartbeat HeartbeatConfig }
type HeartbeatConfig ¶
type L1EndpointConfig ¶
type L1EndpointConfig struct { L1NodeAddr string // Address of L1 User JSON-RPC endpoint to use (eth namespace required) // L1TrustRPC: if we trust the L1 RPC we do not have to validate L1 response contents like headers // against block hashes, or cached transaction sender addresses. // Thus we can sync faster at the risk of the source RPC being wrong. L1TrustRPC bool // L1RPCKind identifies the RPC provider kind that serves the RPC, // to inform the optimal usage of the RPC for transaction receipts fetching. L1RPCKind sources.RPCProviderKind }
type L1EndpointSetup ¶
type L1EndpointSetup interface { // Setup a RPC client to a L1 node to pull rollup input-data from. // The results of the RPC client may be trusted for faster processing, or strictly validated. // The kind of the RPC may be non-basic, to optimize RPC usage. Setup(ctx context.Context, log log.Logger) (cl client.RPC, trust bool, kind sources.RPCProviderKind, err error) }
type L2EndpointConfig ¶
type L2EndpointConfig struct { L2EngineAddr string // Address of L2 Engine JSON-RPC endpoint to use (engine and eth namespace required) // JWT secrets for L2 Engine API authentication during HTTP or initial Websocket communication. // Any value for an IPC connection. L2EngineJWTSecret [32]byte }
func (*L2EndpointConfig) Check ¶
func (cfg *L2EndpointConfig) Check() error
type L2EndpointSetup ¶
type LogConfig ¶
type LogConfig struct { Level string // Log level: trace, debug, info, warn, error, crit. Capitals are accepted too. Color bool // Color the log output. Defaults to true if terminal is detected. Format string // Format the log output. Supported formats: 'text', 'json' }
func DefaultLogConfig ¶
func DefaultLogConfig() LogConfig
type MetricsConfig ¶
func (MetricsConfig) Check ¶
func (m MetricsConfig) Check() error
type OpNode ¶
type OpNode struct {
// contains filtered or unexported fields
}
func (*OpNode) HTTPEndpoint ¶
func (*OpNode) ListenAddr ¶
func (*OpNode) OnNewL1Finalized ¶
func (n *OpNode) OnNewL1Finalized(ctx context.Context, sig eth.L1BlockRef)
func (*OpNode) OnNewL1Head ¶
func (n *OpNode) OnNewL1Head(ctx context.Context, sig eth.L1BlockRef)
func (*OpNode) OnNewL1Safe ¶
func (n *OpNode) OnNewL1Safe(ctx context.Context, sig eth.L1BlockRef)
func (*OpNode) OnUnsafeL2Payload ¶
func (*OpNode) PublishL2Payload ¶
type PreparedL1Endpoint ¶
type PreparedL1Endpoint struct { Client client.RPC TrustRPC bool RPCProviderKind sources.RPCProviderKind }
PreparedL1Endpoint enables testing with an in-process pre-setup RPC connection to L1
type PreparedL2Endpoints ¶
PreparedL2Endpoints enables testing with in-process pre-setup RPC connections to L2 engines
func (*PreparedL2Endpoints) Check ¶
func (p *PreparedL2Endpoints) Check() error
type RPCConfig ¶
func (*RPCConfig) HttpEndpoint ¶
type RuntimeCfgL1Source ¶ added in v0.10.5
type RuntimeConfig ¶ added in v0.10.5
type RuntimeConfig struct {
// contains filtered or unexported fields
}
RuntimeConfig maintains runtime-configurable options. These options are loaded based on initial loading + updates for every subsequent L1 block. Only the *latest* values are maintained however, the runtime config has no concept of chain history, does not require any archive data, and may be out of sync with the rollup derivation process.
func NewRuntimeConfig ¶ added in v0.10.5
func NewRuntimeConfig(log log.Logger, l1Client RuntimeCfgL1Source, rollupCfg *rollup.Config) *RuntimeConfig
func (*RuntimeConfig) Load ¶ added in v0.10.5
func (r *RuntimeConfig) Load(ctx context.Context, l1Ref eth.L1BlockRef) error
Load resets the runtime configuration by fetching the latest config data from L1 at the given L1 block. Load is safe to call concurrently, but will lock the runtime configuration modifications only, and will thus not block other Load calls with possibly alternative L1 block views.
func (*RuntimeConfig) P2PSequencerAddress ¶ added in v0.10.5
func (r *RuntimeConfig) P2PSequencerAddress() common.Address