Documentation ¶
Index ¶
- Constants
- Variables
- func BigMin(a, b *big.Int) *big.Int
- func ConvertBatchHeaderToHeader(batchHeader *BatchHeader) *types.Header
- func ExtractPotentialAddress(hash gethcommon.Hash) *gethcommon.Address
- func MaxInt(x, y uint32) uint32
- func RandomStr(n int) string
- func ToCriteria(jsonCriteria FilterCriteriaJSON) filters.FilterCriteria
- func ValueInWei(tokenAmount *big.Int) *big.Int
- type AttestationReport
- type BatchHeader
- type BatchListingResponse
- type BatchListingResponseDeprecated
- type BatchRequest
- type BlockAndReceipts
- type BlockListingResponse
- type BlockSubmissionResponse
- type CalldataRollupHeader
- type ChainFork
- type CrossChainMessage
- type CrossChainMessages
- type CrossChainRootHashes
- type DebugLogVisibility
- type Enclave
- type EnclaveAdmin
- type EnclaveClientRPC
- type EnclaveID
- type EnclaveInit
- type EnclavePublicConfig
- type EncodedAttestationReport
- type EncodedBatchMsg
- type EncodedBatchRequest
- type EncodedBlobHashes
- type EncodedRollup
- type EncryptedParamsLogSubscription
- type EncryptedRPCRequest
- type EncryptedRequest
- type EncryptedSharedEnclaveSecret
- type EncryptedSubscriptionLogs
- type EncryptedTransactions
- type EncryptedTx
- type ExtBatch
- type ExtCrossChainBundle
- type ExtRollup
- type ExtRollupMetadata
- type FilterCriteria
- type FilterCriteriaJSON
- type FinalityType
- type L1Address
- type L1BlockHash
- type L1DepositTx
- type L1Event
- type L1InitializeSecretTx
- type L1PermissionSeqTx
- type L1Receipt
- type L1Receipts
- type L1RequestSecretTx
- type L1RespondSecretTx
- type L1RollupHashes
- type L1RollupTx
- type L1SetImportantContractsTx
- type L1TenEventType
- type L1TenTransaction
- type L1Transaction
- type L1TxData
- type L2Address
- type L2BatchHash
- type L2PricedTransaction
- type L2PricedTransactions
- type L2Receipt
- type L2Receipts
- type L2RollupHash
- type L2Transactions
- type L2Tx
- type L2TxHash
- type ListPrivateTransactionsQueryParams
- type LogSubscription
- type NodeType
- type Nonce
- type PrivateTransactionsQueryResponse
- type ProcessedL1Data
- type ProducedSecretResponse
- type PublicBatch
- type PublicBatchDeprecated
- type PublicBlock
- type PublicRollup
- type PublicRollupMetadata
- type PublicTransaction
- type QueryPagination
- type RollupHeader
- type RollupListingResponse
- type SerializedCrossChainTree
- type StateRoot
- type Status
- type StatusCode
- type StreamL2UpdatesResponse
- type SystemContractAddresses
- type SystemError
- type TenNetworkInfo
- type TransactionListingResponse
- type TxAndReceiptAndBlobs
- type TxHash
- type ValueTransferEvent
- type ValueTransferEvents
Constants ¶
const ( ListPrivateTransactionsCQMethod = "0x0000000000000000000000000000000000000002" CreateSessionKeyCQMethod = "0x0000000000000000000000000000000000000003" ActivateSessionKeyCQMethod = "0x0000000000000000000000000000000000000004" DeactivateSessionKeyCQMethod = "0x0000000000000000000000000000000000000005" DeleteSessionKeyCQMethod = "0x0000000000000000000000000000000000000006" )
CustomQuery methods
const ( L1GenesisHeight = uint64(0) L2GenesisHeight = uint64(0) L2GenesisSeqNo = uint64(1) L2SysContractGenesisSeqNo = uint64(2) SyntheticTxGasLimit = params.MaxGasLimit )
Variables ¶
These are the multipliers for ERC20 and native ETH value denominations Example: To get the wei value of an amount in whole tokens, use
new(big.Int).Mul(value, big.NewInt(common.Token))
var FailedDecryptErr = errors.New("failed to decrypt RPC payload. please use the correct enclave key")
FailedDecryptErr - when the TEN enclave fails to decrypt an RPC request
var GethGenesisParentHash = common.Hash{}
Functions ¶
func ConvertBatchHeaderToHeader ¶ added in v0.28.0
func ConvertBatchHeaderToHeader(batchHeader *BatchHeader) *types.Header
TODO - use exposed headers once #3987 is completed.
func ExtractPotentialAddress ¶
func ExtractPotentialAddress(hash gethcommon.Hash) *gethcommon.Address
ExtractPotentialAddress - given a 32 byte hash , it checks whether it can be an address and extracts that
func ToCriteria ¶ added in v0.24.0
func ToCriteria(jsonCriteria FilterCriteriaJSON) filters.FilterCriteria
Types ¶
type AttestationReport ¶
type AttestationReport struct { Report []byte // the signed bytes of the report which includes some encrypted identifying data PubKey []byte // a public key that can be used to send encrypted data back to the TEE securely (should only be used once Report has been verified) EnclaveID common.Address // address identifying the owner of the TEE which signed this report, can also be verified from the encrypted Report data HostAddress string // the IP address on which the host can be contacted by other Obscuro hosts for peer-to-peer communication }
AttestationReport represents a signed attestation report from a TEE and some metadata about the source of it to verify it
func DecodeAttestation ¶
func DecodeAttestation(encoded EncodedAttestationReport) (*AttestationReport, error)
type BatchHeader ¶
type BatchHeader struct { ParentHash L2BatchHash `json:"parentHash"` Root StateRoot `json:"stateRoot"` TxHash common.Hash `json:"transactionsRoot"` ReceiptHash common.Hash `json:"receiptsRoot"` Number *big.Int `json:"number"` // height of the batch SequencerOrderNo *big.Int `json:"sequencerOrderNo"` // multiple batches can be created with the same height in case of L1 reorgs. The sequencer is responsible for including all of them in the rollups. GasLimit uint64 `json:"gasLimit"` GasUsed uint64 `json:"gasUsed"` Time uint64 `json:"timestamp"` Extra []byte `json:"extraData"` BaseFee *big.Int `json:"baseFee"` Coinbase common.Address `json:"coinbase"` // The custom TEN fields. L1Proof L1BlockHash `json:"l1Proof"` // the L1 block used by the enclave to generate the current batch Signature []byte `json:"signature"` CrossChainRoot common.Hash `json:"crossChainTreeHash"` // This is the root hash of a merkle tree, built from all the cross chain messages and transfers that need to go on MainNet. CrossChainTree SerializedCrossChainTree `json:"crossChainTree"` // Those are the leafs of the merkle tree hashed for privacy. Necessary for clients to be able to build proofs as they have no access to all transactions in a batch or their receipts. }
BatchHeader is a public / plaintext struct that holds common properties of batches. Making changes to this struct will require GRPC + GRPC Converters regen
func (*BatchHeader) Hash ¶
func (b *BatchHeader) Hash() L2BatchHash
Hash returns the block hash of the header, which is simply the keccak256 hash of its RLP encoding excluding the signature.
func (*BatchHeader) IsGenesis ¶ added in v0.25.0
func (b *BatchHeader) IsGenesis() bool
IsGenesis indicates whether the batch is the genesis batch. todo (#718) - Change this to a check against a hardcoded genesis hash.
func (*BatchHeader) MarshalJSON ¶
func (b *BatchHeader) MarshalJSON() ([]byte, error)
MarshalJSON custom marshals the BatchHeader into a json
func (*BatchHeader) UnmarshalJSON ¶
func (b *BatchHeader) UnmarshalJSON(data []byte) error
type BatchListingResponse ¶
type BatchListingResponse struct { BatchesData []PublicBatch Total uint64 }
type BatchListingResponseDeprecated ¶ added in v0.24.0
type BatchListingResponseDeprecated struct { BatchesData []PublicBatchDeprecated Total uint64 }
type BatchRequest ¶
type BatchRequest struct { Requester string // The address of the requester, used to direct the response FromSeqNo *big.Int // The requester's view of the current head seq no, or nil if they haven't stored any batches. }
BatchRequest is used when requesting a range of batches from a peer.
type BlockAndReceipts ¶
type BlockAndReceipts struct { BlockHeader *types.Header TxsWithReceipts []*TxAndReceiptAndBlobs // contains filtered or unexported fields }
BlockAndReceipts - a structure that contains a fuller view of a block. It allows iterating over the successful transactions, using the receipts. The receipts are bundled in the host node and thus verification is performed over their correctness. To work properly, all of the receipts are required, due to rlp encoding pruning some of the information. The receipts must also be in the correct order.
func ParseBlockAndReceipts ¶
func ParseBlockAndReceipts(block *types.Header, receiptsAndBlobs []*TxAndReceiptAndBlobs) (*BlockAndReceipts, error)
ParseBlockAndReceipts - will create a container struct that has preprocessed the receipts and verified if they indeed match the receipt root hash in the block.
func (*BlockAndReceipts) Receipts ¶
func (br *BlockAndReceipts) Receipts() L1Receipts
func (*BlockAndReceipts) RelevantTransactions ¶ added in v0.27.0
func (br *BlockAndReceipts) RelevantTransactions() *types.Transactions
RelevantTransactions - returns slice containing only the transactions that have receipts with successful status.
type BlockListingResponse ¶
type BlockListingResponse struct { BlocksData []PublicBlock Total uint64 }
type BlockSubmissionResponse ¶
type BlockSubmissionResponse struct { ProducedSecretResponses []*ProducedSecretResponse // The responses to any secret requests in the ingested L1 block. RejectError *errutil.BlockRejectError // If block was rejected, contains information about what block to submit next. RollupMetadata []ExtRollupMetadata // Metadata for each rollup that the host needs to prepare APIs }
BlockSubmissionResponse is the response sent from the enclave back to the node after ingesting a block
type CalldataRollupHeader ¶
type CalldataRollupHeader struct { FirstBatchSequence *big.Int FirstCanonBatchHeight *big.Int FirstCanonParentHash L2BatchHash Coinbase common.Address BaseFee *big.Int GasLimit uint64 StartTime uint64 BatchTimeDeltas [][]byte // todo - minimize assuming a default of 1 sec and then store only exceptions L1HeightDeltas [][]byte // delta of the block height. Stored as a byte array because rlp can't encode negative numbers ReOrgs [][]byte `rlp:"optional"` // sparse list of reorged headers - non null only for reorgs. }
CalldataRollupHeader contains all information necessary to reconstruct the batches included in the rollup. This data structure is serialised, compressed, and encrypted, before being serialised again in the rollup.
type ChainFork ¶
type ChainFork struct { NewCanonical *types.Header OldCanonical *types.Header CommonAncestor *types.Header CanonicalPath []L1BlockHash NonCanonicalPath []L1BlockHash }
ChainFork - represents the result of walking the chain when processing a fork
type CrossChainMessage ¶
type CrossChainMessage = MessageBus.StructsCrossChainMessage
type CrossChainMessages ¶
type CrossChainMessages = []CrossChainMessage
type CrossChainRootHashes ¶ added in v0.28.0
type CrossChainRootHashes [][]byte
func (CrossChainRootHashes) ToHexString ¶ added in v0.28.0
func (hashes CrossChainRootHashes) ToHexString() string
type DebugLogVisibility ¶ added in v0.28.0
type DebugLogVisibility struct { // identify the event Address *gethcommon.Address `json:"contractAddress"` EventSig *gethcommon.Hash `json:"eventSig"` // the contract configuration AutoContract bool `json:"defaultContract"` TransparentContract *bool `json:"transparentContract"` // the explicit saved configuration for this event type EventConfigPublic *bool `json:"eventConfigPublic"` Topic1 *bool `json:"topic1Relevant"` Topic2 *bool `json:"topic2Relevant"` Topic3 *bool `json:"topic3Relevant"` Sender *bool `json:"senderRelevant"` // if the event is auto-detected, return which topics will see it AutoVisibility *bool `json:"eventAutoVisibility"` AutoPublic *bool `json:"eventAutoPublic"` RelAddress1 *bool `json:"topic1AutoRelevant"` RelAddress2 *bool `json:"topic2AutoRelevant"` RelAddress3 *bool `json:"topic3AutoRelevant"` // position of the event BlockNumber uint64 `json:"blockNumber" rlp:"-"` TxHash gethcommon.Hash `json:"transactionHash" gencodec:"required" rlp:"-"` TxIndex uint `json:"transactionIndex" rlp:"-"` BlockHash gethcommon.Hash `json:"blockHash" rlp:"-"` Index uint `json:"logIndex" rlp:"-"` }
DebugLogVisibility are the payloads returned when using the DebugGetLogs endpoint they are intended for the contract developer to debug visibility issues.
type Enclave ¶
type Enclave interface { EnclaveInit EnclaveAdmin EnclaveClientRPC }
Enclave represents the API of the service that runs inside the TEE.
type EnclaveAdmin ¶ added in v1.0.0
type EnclaveAdmin interface { // MakeActive - backup sequencer enclave can become active at the command of the host MakeActive() SystemError // SubmitL1Block - Used for the host to submit L1 pre-processed blocks to the enclave, these may be: // a. historic block - if the enclave is behind and in the process of catching up with the L1 state // b. the latest block published by the L1, to which the enclave should respond with a rollup // It is the responsibility of the host to gossip the returned rollup // For good functioning the caller should always submit blocks ordered by height // submitting a block before receiving ancestors of it, will result in it being ignored SubmitL1Block(ctx context.Context, processed *ProcessedL1Data) (*BlockSubmissionResponse, SystemError) // SubmitBatch submits a batch received from the sequencer for processing. SubmitBatch(ctx context.Context, batch *ExtBatch) SystemError // HealthCheck returns whether the enclave is in a healthy state HealthCheck(context.Context) (bool, SystemError) // GetBatch - retrieve a batch if existing within the enclave db. GetBatch(ctx context.Context, hash L2BatchHash) (*ExtBatch, SystemError) // GetBatchBySeqNo - retrieve batch by sequencer number if it's in the db. GetBatchBySeqNo(ctx context.Context, seqNo uint64) (*ExtBatch, SystemError) // GetRollupData - retrieve the first batch sequence and start time for a given rollup. GetRollupData(ctx context.Context, hash L2RollupHash) (*PublicRollupMetadata, SystemError) // CreateBatch - creates a new head batch extending the previous one for the latest known L1 head if the node is // a sequencer. Will panic otherwise. CreateBatch(ctx context.Context, skipIfEmpty bool) SystemError // CreateRollup - will create a new rollup by going through the sequencer if the node is a sequencer // or panic otherwise. CreateRollup(ctx context.Context, fromSeqNo uint64) (*ExtRollup, []*kzg4844.Blob, SystemError) // StreamL2Updates - will stream any new batches as they are created/detected // All will be queued in the channel that has been returned. StreamL2Updates() (chan StreamL2UpdatesResponse, func()) ExportCrossChainData(context.Context, uint64, uint64) (*ExtCrossChainBundle, SystemError) // Stop gracefully stops the enclave Stop() SystemError // StopClient stops the enclave client if one exists - only implemented by the RPC layer StopClient() SystemError }
EnclaveAdmin provides administrative functions for managing an enclave.
type EnclaveClientRPC ¶ added in v1.0.0
type EnclaveClientRPC interface { EncryptedRPC(ctx context.Context, encryptedReq EncryptedRequest) (*responses.EnclaveResponse, SystemError) // Subscribe adds a log subscription to the enclave under the given ID, provided the request is authenticated // correctly. The events will be populated in the BlockSubmissionResponse. If there is an existing subscription // with the given ID, it is overwritten. Subscribe(ctx context.Context, id rpc.ID, encryptedParams EncryptedParamsLogSubscription) SystemError // Unsubscribe removes the log subscription with the given ID from the enclave. If there is no subscription with // the given ID, nothing is deleted. Unsubscribe(id rpc.ID) SystemError // DebugTraceTransaction returns the trace of a transaction DebugTraceTransaction(ctx context.Context, hash gethcommon.Hash, config *tracers.TraceConfig) (json.RawMessage, SystemError) GetCode(ctx context.Context, address gethcommon.Address, blockNrOrHash rpc.BlockNumberOrHash) ([]byte, SystemError) // GetTotalContractCount returns the total number of contracts that have been deployed GetTotalContractCount(context.Context) (*big.Int, SystemError) // EnclavePublicConfig returns network data that is known to the enclave but can be shared publicly EnclavePublicConfig(context.Context) (*EnclavePublicConfig, SystemError) }
EnclaveClientRPC - exposes RPC methods called by users
type EnclaveInit ¶ added in v1.0.0
type EnclaveInit interface { // Status checks whether the enclave is ready to process requests - only implemented by the RPC layer Status(context.Context) (Status, SystemError) // Attestation - Produces an attestation report which will be used to request the shared secret from another enclave. Attestation(context.Context) (*AttestationReport, SystemError) // GenerateSecret - the genesis enclave is responsible with generating the secret entropy GenerateSecret(context.Context) (EncryptedSharedEnclaveSecret, SystemError) // InitEnclave - initialise an enclave with a seed received by another enclave InitEnclave(ctx context.Context, secret EncryptedSharedEnclaveSecret) SystemError // EnclaveID - returns the enclave's ID EnclaveID(context.Context) (EnclaveID, SystemError) // RPCEncryptionKey - returns the key used RPCEncryptionKey(context.Context) ([]byte, SystemError) }
EnclaveInit defines methods for initializing and managing the state of an enclave.
type EnclavePublicConfig ¶
type EnclavePublicConfig struct { L2MessageBusAddress gethcommon.Address TransactionPostProcessorAddress gethcommon.Address PublicSystemContracts map[string]gethcommon.Address }
type EncodedAttestationReport ¶
type EncodedAttestationReport []byte
func EncodeAttestation ¶
func EncodeAttestation(att *AttestationReport) (EncodedAttestationReport, error)
type EncodedBatchMsg ¶
type EncodedBatchMsg []byte
type EncodedBatchRequest ¶
type EncodedBatchRequest []byte
type EncodedBlobHashes ¶ added in v0.28.0
type EncodedBlobHashes []byte
type EncodedRollup ¶
type EncodedRollup []byte
func EncodeRollup ¶
func EncodeRollup(r *ExtRollup) (EncodedRollup, error)
type EncryptedParamsLogSubscription ¶
type EncryptedParamsLogSubscription []byte
type EncryptedRPCRequest ¶ added in v1.0.0
type EncryptedRPCRequest struct { Req EncryptedRequest IsTx bool // we can make this an enum if we need to provide more info to the TEN host }
EncryptedRPCRequest - an encrypted request with extra plaintext metadata
type EncryptedRequest ¶ added in v1.0.0
type EncryptedRequest []byte
type EncryptedSharedEnclaveSecret ¶
type EncryptedSharedEnclaveSecret []byte
type EncryptedSubscriptionLogs ¶
EncryptedSubscriptionLogs - Alias for the event subscription updates going out of the enclave.
type EncryptedTransactions ¶
type EncryptedTransactions []byte // A blob of encrypted transactions, as they're stored in the rollup, with the nonce prepended.
type EncryptedTx ¶
type EncryptedTx []byte // A single transaction, encoded as a JSON list of transaction binary hexes and encrypted using the enclave's public key
type ExtBatch ¶
type ExtBatch struct { Header *BatchHeader // todo - remove and replace with enclave API TxHashes []TxHash // The hashes of the transactions included in the batch. EncryptedTxBlob EncryptedTransactions // contains filtered or unexported fields }
ExtBatch is an encrypted form of batch used when passing the batch around outside of an enclave.
func DecodeExtBatch ¶
func (*ExtBatch) Hash ¶
func (b *ExtBatch) Hash() L2BatchHash
Hash returns the keccak256 hash of the batch's header. The hash is computed on the first call and cached thereafter.
type ExtCrossChainBundle ¶ added in v0.24.1
type ExtCrossChainBundle struct { LastBatchHash gethcommon.Hash Signature []byte L1BlockHash gethcommon.Hash // The block hash that's expected to be canonical on signature submission L1BlockNum *big.Int // The number of the block that has the block hash. This is used to verify the block hash. CrossChainRootHashes CrossChainRootHashes // The CrossChainRoots of the batches that are being submitted }
func (ExtCrossChainBundle) HashPacked ¶ added in v0.24.1
func (bundle ExtCrossChainBundle) HashPacked() (common.Hash, error)
type ExtRollup ¶
type ExtRollup struct { Header *RollupHeader // the fields required by the management contract CalldataRollupHeader []byte // encrypted header useful for recreating the batches BatchPayloads []byte // The transactions included in the rollup, in external/encrypted form. // contains filtered or unexported fields }
ExtRollup is an encrypted form of rollup used when passing the rollup around outside an enclave.
func DecodeRollup ¶
func DecodeRollup(encoded EncodedRollup) (*ExtRollup, error)
func (*ExtRollup) Hash ¶
func (r *ExtRollup) Hash() L2RollupHash
Hash returns the keccak256 hash of the rollup's header. The hash is computed on the first call and cached thereafter.
type ExtRollupMetadata ¶ added in v1.0.0
type ExtRollupMetadata struct {
CrossChainTree []byte // All the elements of the cross chain tree when building the rollup; Host uses this for serving cross chain proofs;
}
ExtRollupMetadata metadata that should not be in the rollup, but rather is derived from one. This should all be public information as it is passed back to the host!
type FilterCriteria ¶ added in v0.24.0
type FilterCriteria ethereum.FilterQuery
FilterCriteria represents a request to create a new filter. Same as ethereum.FilterQuery but with UnmarshalJSON() method. duplicated from geth to tweak the unmarshalling
func (*FilterCriteria) UnmarshalJSON ¶ added in v0.24.0
func (args *FilterCriteria) UnmarshalJSON(data []byte) error
UnmarshalJSON sets *args fields with given data.
type FilterCriteriaJSON ¶
type FilterCriteriaJSON struct { BlockHash *gethcommon.Hash `json:"blockHash"` FromBlock *rpc.BlockNumber `json:"fromBlock"` ToBlock *rpc.BlockNumber `json:"toBlock"` Addresses []gethcommon.Address `json:"addresses"` Topics [][]gethcommon.Hash `json:"topics"` }
FilterCriteriaJSON is a structure that JSON-serialises to a format that can be successfully deserialised into a filters.FilterCriteria object (round-tripping a filters.FilterCriteria to JSON and back doesn't work, due to a custom serialiser implemented by filters.FilterCriteria).
func SerializableFilterCriteria ¶ added in v0.25.0
func SerializableFilterCriteria(crit FilterCriteria) FilterCriteriaJSON
type FinalityType ¶
type FinalityType string
const ( MempoolPending FinalityType = "Pending" BatchFinal FinalityType = "Final" )
type L1BlockHash ¶
type L1DepositTx ¶ added in v1.0.0
type L1DepositTx struct { Amount *big.Int // Amount to be deposited To *gethcommon.Address // Address the ERC20 Transfer was made to (always be the Management Contract Addr) Sender *gethcommon.Address // Address that issued the ERC20, the token holder or tx.origin TokenContract *gethcommon.Address // Address of the ERC20 Contract address that was executed }
type L1Event ¶ added in v1.0.0
L1Event represents a single event type and its associated transactions
type L1InitializeSecretTx ¶ added in v1.0.0
type L1InitializeSecretTx struct { EnclaveID *gethcommon.Address InitialSecret []byte Attestation EncodedAttestationReport }
type L1PermissionSeqTx ¶ added in v1.0.0
type L1PermissionSeqTx struct{}
type L1Receipts ¶
type L1RequestSecretTx ¶ added in v1.0.0
type L1RequestSecretTx struct {
Attestation EncodedAttestationReport
}
type L1RespondSecretTx ¶ added in v1.0.0
type L1RespondSecretTx struct { Secret []byte RequesterID gethcommon.Address AttesterID gethcommon.Address AttesterSig []byte }
type L1RollupHashes ¶ added in v1.0.0
type L1RollupHashes struct {
BlobHashes []gethcommon.Hash
}
type L1RollupTx ¶ added in v1.0.0
type L1RollupTx struct {
Rollup EncodedRollup
}
type L1SetImportantContractsTx ¶ added in v1.0.0
type L1SetImportantContractsTx struct { Key string NewAddress gethcommon.Address }
type L1TenEventType ¶ added in v1.0.0
type L1TenEventType uint8 // Change to uint8 for RLP serialization
L1TenEventType represents different types of L1 transactions we monitor for
const ( RollupTx L1TenEventType = iota InitialiseSecretTx SecretRequestTx SecretResponseTx CrossChainMessageTx CrossChainValueTranserTx SequencerAddedTx SequencerRevokedTx SetImportantContractsTx )
type L1TenTransaction ¶ added in v1.0.0
type L1TenTransaction interface{}
L1TenTransaction is an abstraction that transforms an Ethereum transaction into a format that can be consumed more easily by TEN.
type L1Transaction ¶
type L1Transaction = types.Transaction
type L1TxData ¶ added in v1.0.0
type L1TxData struct { Transaction *types.Transaction Receipt *types.Receipt Blobs []*kzg4844.Blob // Only populated for blob transactions SequencerEnclaveID gethcommon.Address // Only non-zero when a new enclave is added as a sequencer CrossChainMessages CrossChainMessages // Only populated for xchain messages ValueTransfers ValueTransferEvents // Only populated for xchain transfers Proof []byte // Some merkle proof TBC }
L1TxData represents an L1 transaction that are relevant to us
func (*L1TxData) HasSequencerEnclaveID ¶ added in v1.0.0
HasSequencerEnclaveID helper method to check if SequencerEnclaveID is set to avoid custom RLP when we send over grpc
type L2Address ¶
func MaskedSender ¶ added in v1.0.0
type L2PricedTransaction ¶ added in v0.21.0
type L2PricedTransactions ¶ added in v0.21.0
type L2PricedTransactions []*L2PricedTransaction
func (L2PricedTransactions) ToTransactions ¶ added in v0.21.0
func (txs L2PricedTransactions) ToTransactions() types.Transactions
type L2Receipts ¶
type L2RollupHash ¶
type L2Transactions ¶
type L2Transactions = types.Transactions
type L2Tx ¶
type L2Tx = types.Transaction
type ListPrivateTransactionsQueryParams ¶ added in v0.25.0
type ListPrivateTransactionsQueryParams struct { Address common.Address `json:"address"` Pagination QueryPagination `json:"pagination"` }
type LogSubscription ¶
type LogSubscription struct { // ViewingKey - links this subscription request to an externally owed account ViewingKey *viewingkey.RPCSignedViewingKey // A subscriber-defined filter to apply to the stream of logs. Filter *FilterCriteriaJSON }
LogSubscription is an authenticated subscription to logs.
func CreateAuthenticatedLogSubscriptionPayload ¶ added in v0.24.1
func CreateAuthenticatedLogSubscriptionPayload(args []interface{}, vk *viewingkey.ViewingKey) (*LogSubscription, error)
type NodeType ¶
type NodeType int
NodeType represents the type of the node.
func ToNodeType ¶
func (*NodeType) UnmarshalText ¶ added in v0.28.0
type PrivateTransactionsQueryResponse ¶ added in v0.25.0
type ProcessedL1Data ¶ added in v1.0.0
ProcessedL1Data is submitted to the enclave by the guardian
func (*ProcessedL1Data) AddEvent ¶ added in v1.0.0
func (p *ProcessedL1Data) AddEvent(tenEventType L1TenEventType, tx *L1TxData)
func (*ProcessedL1Data) GetEvents ¶ added in v1.0.0
func (p *ProcessedL1Data) GetEvents(txType L1TenEventType) []*L1TxData
type ProducedSecretResponse ¶
type ProducedSecretResponse struct { Secret []byte RequesterID gethcommon.Address // enclaveID of the enclave that requested the secret AttesterID gethcommon.Address // enclaveID of the enclave that produced the secret HostAddress string }
ProducedSecretResponse contains the data to publish to L1 in response to a secret request discovered while processing an L1 block
type PublicBatch ¶
type PublicBatch struct { SequencerOrderNo *big.Int `json:"sequence"` FullHash common.Hash `json:"fullHash"` Height *big.Int `json:"height"` TxCount *big.Int `json:"txCount"` Header *BatchHeader `json:"header"` EncryptedTxBlob EncryptedTransactions `json:"encryptedTxBlob"` }
type PublicBatchDeprecated ¶ added in v0.24.0
type PublicBatchDeprecated struct { BatchHeader TxHashes []TxHash `json:"txHashes"` }
TODO (@will) remove when tenscan UI has been updated
type PublicBlock ¶
type PublicRollup ¶ added in v0.24.0
type PublicRollupMetadata ¶ added in v0.24.0
PublicRollupMetadata contains internal rollup data that can be requested from the enclave.
type PublicTransaction ¶
type PublicTransaction struct { TransactionHash TxHash BatchHeight *big.Int BatchTimestamp uint64 Finality FinalityType }
type QueryPagination ¶
func (*QueryPagination) UnmarshalJSON ¶
func (p *QueryPagination) UnmarshalJSON(data []byte) error
type RollupHeader ¶
type RollupHeader struct { // CompressionL1Head is the reference L1 block. If a rollup is published in a fork where it does not exist, the rollup will not be decomperssible // by validators who only use the L1 as a DA, thus upon submission if this block is not found the rollup should be invalid. CompressionL1Head L1BlockHash CompressionL1Number *big.Int CrossChainRoot common.Hash // The root hash of the cross chain tree. LastBatchSeqNo uint64 BlobHash common.Hash CompositeHash common.Hash // composite of everything Signature []byte // The signature of the sequencer enclave over the composite hash }
RollupHeader is a public / plaintext struct that holds common properties of rollups. All these fields are processed by the Management contract
func (*RollupHeader) Hash ¶
func (r *RollupHeader) Hash() L2RollupHash
Hash returns the block hash of the header, which is simply the keccak256 hash of its RLP encoding excluding the signature.
func (*RollupHeader) MarshalJSON ¶
func (r *RollupHeader) MarshalJSON() ([]byte, error)
MarshalJSON custom marshals the RollupHeader into a json
type RollupListingResponse ¶ added in v0.24.0
type RollupListingResponse struct { RollupsData []PublicRollup Total uint64 }
type SerializedCrossChainTree ¶ added in v0.24.1
type SerializedCrossChainTree = []byte
type Status ¶
type Status struct { StatusCode StatusCode L1Head gethcommon.Hash L2Head *big.Int EnclaveID EnclaveID }
Status represents the enclave's current state - whether the enclave is healthy and ready to process requests, as well as its latest known heads for the L1 and L2 chains and enclave ID derived from the public key
type StatusCode ¶
type StatusCode int
const ( Running StatusCode = iota // the enclave is running, accepting L1 blocks AwaitingSecret // the enclave has not received the network secret and cannot process L1 blocks )
type StreamL2UpdatesResponse ¶
type StreamL2UpdatesResponse struct { Batch *ExtBatch Logs EncryptedSubscriptionLogs }
StreamL2UpdatesResponse - the struct encoded for each response message when streaming batches out of the enclave. The properties inside need to be encrypted according to the privacy rules.
type SystemContractAddresses ¶ added in v1.0.0
type SystemContractAddresses map[string]*gethcommon.Address
func (*SystemContractAddresses) ToString ¶ added in v1.0.0
func (s *SystemContractAddresses) ToString() string
type SystemError ¶
type SystemError interface {
Error() string
}
SystemError is the interface for the internal errors generated in the Enclave and consumed by the Host
type TenNetworkInfo ¶ added in v0.26.1
type TenNetworkInfo struct { ManagementContractAddress common.Address L1StartHash common.Hash MessageBusAddress common.Address L2MessageBusAddress common.Address ImportantContracts map[string]common.Address // map of contract name to address TransactionPostProcessorAddress common.Address PublicSystemContracts map[string]common.Address }
type TransactionListingResponse ¶
type TransactionListingResponse struct { TransactionsData []PublicTransaction Total uint64 }
type TxAndReceiptAndBlobs ¶ added in v0.28.0
type ValueTransferEvent ¶
type ValueTransferEvents ¶
type ValueTransferEvents = []ValueTransferEvent
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
nolint
|
nolint |
native
// Package native: This file was copied/adapted from geth - go-ethereum/eth/tracers // // // Copyright 2021 The go-ethereum Authors // This file is part of the go-ethereum library.
|
// Package native: This file was copied/adapted from geth - go-ethereum/eth/tracers // // // Copyright 2021 The go-ethereum Authors // This file is part of the go-ethereum library. |