Documentation ¶
Index ¶
- func GetAuthenticatedSender(chainID int64, tx *types.Transaction) (*gethcommon.Address, error)
- func GetTxSigner(tx *common.L2Tx) (gethcommon.Address, error)
- func LogMethodDuration(logger gethlog.Logger, stopWatch *measure.Stopwatch, msg string, args ...any)
- func VerifySignature(chainID int64, tx *types.Transaction) error
- type Batch
- func (b *Batch) Encode() ([]byte, error)
- func (b *Batch) Hash() common.L2BatchHash
- func (b *Batch) Number() *big.Int
- func (b *Batch) NumberU64() uint64
- func (b *Batch) ResetHash()
- func (b *Batch) SeqNo() *big.Int
- func (b *Batch) Size() (int, error)
- func (b *Batch) ToExtBatch(transactionBlobCrypto crypto.DataEncryptionService, ...) (*common.ExtBatch, error)
- type ContractVisibilityConfig
- type EventVisibilityConfig
- type InternalReceipt
- type Rollup
- type TxExecResult
- type TxExecResults
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAuthenticatedSender ¶
func GetAuthenticatedSender(chainID int64, tx *types.Transaction) (*gethcommon.Address, error)
GetAuthenticatedSender - Get sender and tx nonce from transaction
func GetTxSigner ¶ added in v0.22.0
func GetTxSigner(tx *common.L2Tx) (gethcommon.Address, error)
GetTxSigner returns the address that signed a transaction
func LogMethodDuration ¶
func LogMethodDuration(logger gethlog.Logger, stopWatch *measure.Stopwatch, msg string, args ...any)
LogMethodDuration - call only with "defer"
func VerifySignature ¶
func VerifySignature(chainID int64, tx *types.Transaction) error
VerifySignature - Checks that the L2Tx has a valid signature.
Types ¶
type Batch ¶
type Batch struct { Header *common.BatchHeader Transactions []*common.L2Tx // contains filtered or unexported fields }
Batch Data structure only for the internal use of the enclave since transactions are in clear
func DeterministicEmptyBatch ¶
func ToBatch ¶
func ToBatch(extBatch *common.ExtBatch, transactionBlobCrypto crypto.DataEncryptionService, compression compression.DataCompressionService) (*Batch, error)
func (*Batch) Hash ¶
func (b *Batch) Hash() common.L2BatchHash
Hash returns the keccak256 hash of b's header. The hash is computed on the first call and cached thereafter.
func (*Batch) ToExtBatch ¶
func (b *Batch) ToExtBatch(transactionBlobCrypto crypto.DataEncryptionService, compression compression.DataCompressionService) (*common.ExtBatch, error)
type ContractVisibilityConfig ¶ added in v0.28.0
type ContractVisibilityConfig struct { AutoConfig bool // true for contracts that have no explicit configuration Transparent *bool // users can configure contracts to be fully transparent. All events will be public, and it will expose the internal storage. EventConfigs map[gethcommon.Hash]*EventVisibilityConfig // map from the event log signature (topics[0]) to the settings }
ContractVisibilityConfig represents the configuration as defined by the dApp developer in the smart contract
type EventVisibilityConfig ¶ added in v0.28.0
type EventVisibilityConfig struct { AutoConfig bool // true for events that have no explicit configuration Public bool // everyone can see and query for this event Topic1CanView, Topic2CanView, Topic3CanView *bool // If the event is not public, and this is true, it means that the address from topicI is an EOA that can view this event SenderCanView *bool // if true, the tx signer will see this event. Default false }
EventVisibilityConfig - configuration per event by the dApp developer(DD) There are 4 cases: 1. DD doesn't configure anything. - ContractVisibilityConfig.AutoConfig=true 2. DD configures and specifies the contract as transparent - ContractVisibilityConfig.Transparent=true 3. DD configures and specify the contract as non-transparent, but doesn't configure the event - Contract: false/false , EventVisibilityConfig.AutoConfig=true DD configures the contract as non-transparent, and also configures the topics for the event
type InternalReceipt ¶ added in v0.28.0
type InternalReceipt struct { PostState []byte Status uint64 CumulativeGasUsed uint64 EffectiveGasPrice *uint64 CreatedContract *gethcommon.Address TxHash gethcommon.Hash BlockHash gethcommon.Hash BlockNumber *big.Int TransactionIndex uint From gethcommon.Address To *gethcommon.Address TxType uint8 Logs []*types.Log }
InternalReceipt - Equivalent to the geth types.Receipt, but without weird quirks
func (*InternalReceipt) MarshalToJson ¶ added in v0.28.0
func (receipt *InternalReceipt) MarshalToJson() map[string]interface{}
MarshalToJson marshals a transaction receipt into a JSON object. taken from geth
func (*InternalReceipt) ToReceipt ¶ added in v0.28.0
func (receipt *InternalReceipt) ToReceipt() *types.Receipt
type Rollup ¶
type Rollup struct { Header *common.RollupHeader Batches []*Batch Blocks map[common.L1BlockHash]*types.Header // these are the blocks required during compression. The key is the hash // contains filtered or unexported fields }
Rollup - is an internal data structure useful during creation
func (*Rollup) Hash ¶
func (r *Rollup) Hash() common.L2BatchHash
Hash returns the keccak256 hash of b's header. The hash is computed on the first call and cached thereafter.
type TxExecResult ¶ added in v0.28.0
type TxExecResult struct { Receipt *types.Receipt CreatedContracts map[gethcommon.Address]*ContractVisibilityConfig Tx *types.Transaction From *gethcommon.Address Err error }
type TxExecResults ¶ added in v0.28.0
type TxExecResults []*TxExecResult