enclave

package
v0.13.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2023 License: AGPL-3.0 Imports: 52 Imported by: 0

README

This package contains code related to the node's enclave component.

The entry point to the enclave component is the main function in enclave/main/.

The enclave component should be run entirely inside a trusted execution environment, e.g. using EGo (https://www.ego.dev/).

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEnclave

func NewEnclave(
	config config.EnclaveConfig,
	genesis *genesis.Genesis,
	mgmtContractLib mgmtcontractlib.MgmtContractLib,
	logger gethlog.Logger,
) common.Enclave

NewEnclave creates a new enclave. `genesisJSON` is the configuration for the corresponding L1's genesis block. This is used to validate the blocks received from the L1 node if `validateBlocks` is set to true.

func VerifyIdentity

func VerifyIdentity(data []byte, att *common.AttestationReport) error

Types

type AttestationProvider

type AttestationProvider interface {
	// GetReport returns the verifiable attestation report
	GetReport(pubKey []byte, owner gethcommon.Address, hostAddress string) (*common.AttestationReport, error)
	// VerifyReport returns the embedded report data
	VerifyReport(att *common.AttestationReport) ([]byte, error)
}

type DummyAttestationProvider

type DummyAttestationProvider struct{}

func (*DummyAttestationProvider) GetReport

func (e *DummyAttestationProvider) GetReport(pubKey []byte, owner gethcommon.Address, hostAddress string) (*common.AttestationReport, error)

func (*DummyAttestationProvider) VerifyReport

func (e *DummyAttestationProvider) VerifyReport(att *common.AttestationReport) ([]byte, error)

type EgoAttestationProvider

type EgoAttestationProvider struct{}

func (*EgoAttestationProvider) GetReport

func (e *EgoAttestationProvider) GetReport(pubKey []byte, owner gethcommon.Address, hostAddress string) (*common.AttestationReport, error)

func (*EgoAttestationProvider) VerifyReport

func (e *EgoAttestationProvider) VerifyReport(att *common.AttestationReport) ([]byte, error)

todo (#1059) - we need to verify the hash is a recognized enclave - figure out how we solve for upgradability

type IDData

type IDData struct {
	Owner       gethcommon.Address
	PubKey      []byte
	HostAddress string
}

type RPCServer added in v0.8.0

type RPCServer struct {
	generated.UnimplementedEnclaveProtoServer
	// contains filtered or unexported fields
}

RPCServer receives RPC calls to the enclave process and relays them to the enclave.Enclave.

func NewEnclaveRPCServer added in v0.8.0

func NewEnclaveRPCServer(listenAddress string, enclave common.Enclave, logger gethlog.Logger) *RPCServer

NewEnclaveRPCServer prepares an enclave RPCServer (doesn't start listening until `StartServer` is called

func (*RPCServer) AddViewingKey added in v0.8.0

func (*RPCServer) Attestation added in v0.8.0

func (*RPCServer) CreateRollup added in v0.11.0

func (*RPCServer) DebugEventLogRelevancy added in v0.13.0

func (*RPCServer) DebugTraceTransaction added in v0.12.0

func (*RPCServer) EstimateGas added in v0.8.0

func (*RPCServer) GenerateSecret added in v0.8.0

func (*RPCServer) GetBalance added in v0.8.0

func (*RPCServer) GetCode added in v0.8.0

func (*RPCServer) GetLogs added in v0.8.0

func (*RPCServer) GetTransaction added in v0.8.0

func (*RPCServer) GetTransactionCount added in v0.8.0

func (*RPCServer) GetTransactionReceipt added in v0.8.0

func (*RPCServer) HealthCheck added in v0.8.0

func (*RPCServer) InitEnclave added in v0.8.0

func (*RPCServer) ObsCall added in v0.12.0

func (*RPCServer) StartServer added in v0.8.0

func (s *RPCServer) StartServer() error

StartServer starts a RPCServer on the given port on a separate thread. It creates an enclave.Enclave for the provided nodeID, and uses it to respond to incoming RPC messages from the host.

func (*RPCServer) Status added in v0.8.0

Status returns the current status of the RPCServer as an enum value (see common.Status for details)

func (*RPCServer) Stop added in v0.8.0

func (*RPCServer) SubmitBatch added in v0.8.0

func (*RPCServer) SubmitL1Block added in v0.8.0

func (*RPCServer) SubmitTx added in v0.8.0

func (*RPCServer) Subscribe added in v0.8.0

func (*RPCServer) Unsubscribe added in v0.8.0

Directories

Path Synopsis
db
sql
Package debugger: This file was copied/adapted from geth - go-ethereum/eth/tracers
Package debugger: This file was copied/adapted from geth - go-ethereum/eth/tracers

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL