evm

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: AGPL-3.0 Imports: 33 Imported by: 0

README

TEN executes EVM compatible transactions on top of a database that implements the Go-Ethereum interfaces.

The entry point is the evm_facade.

The approach we took was to depend on Go-Ethereum, mock out all consensus related dependencies, and just use the transaction execution functionality.

Documentation

Index

Constants

View Source
const (
	BalanceDecreaseL1Payment       tracing.BalanceChangeReason = 100
	BalanceIncreaseL1Payment       tracing.BalanceChangeReason = 101
	BalanceRevertDecreaseL1Payment tracing.BalanceChangeReason = 102
	BalanceRevertIncreaseL1Payment tracing.BalanceChangeReason = 103
)

Variables

View Source
var ContractTranspMetaData = &bind.MetaData{
	ABI: "[{\"inputs\":[],\"name\":\"visibilityRules\",\"outputs\":[{\"components\":[{\"internalType\":\"enumContractTransparencyConfig.ContractCfg\",\"name\":\"contractCfg\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"eventSignature\",\"type\":\"bytes32\"},{\"internalType\":\"enumContractTransparencyConfig.Field[]\",\"name\":\"visibleTo\",\"type\":\"uint8[]\"}],\"internalType\":\"structContractTransparencyConfig.EventLogConfig[]\",\"name\":\"eventLogConfigs\",\"type\":\"tuple[]\"}],\"internalType\":\"structContractTransparencyConfig.VisibilityConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]",
}

ContractTranspMetaData contains all meta data concerning the TransparencyConfig contract.

View Source
var ErrGasNotEnoughForL1 = errors.New("gas limit too low to pay for execution and l1 fees")
View Source
var PoolAddress = common.HexToAddress("0x0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A")

PoolAddress - address of the pool where the gas will go todo (#627) - this has to be reworked when the gas/fee work starts

Functions

func ExecuteObsCall

func ExecuteObsCall(
	ctx context.Context,
	msg *gethcore.Message,
	s *state.StateDB,
	header *common.BatchHeader,
	storage storage.Storage,
	gethEncodingService gethencoding.EncodingService,
	chainConfig *params.ChainConfig,
	gasEstimationCap uint64,
	config enclaveconfig.EnclaveConfig,
	logger gethlog.Logger,
) (*gethcore.ExecutionResult, error)

ExecuteObsCall - executes the eth_call call

func ExecuteTransactions

func ExecuteTransactions(
	ctx context.Context,
	txs common.L2PricedTransactions,
	s *state.StateDB,
	header *common.BatchHeader,
	storage storage.Storage,
	gethEncodingService gethencoding.EncodingService,
	chainConfig *params.ChainConfig,
	config enclaveconfig.EnclaveConfig,
	fromTxIndex int,
	noBaseFee bool,
	batchGasLimit uint64,
	logger gethlog.Logger,
) (map[common.TxHash]*core.TxExecResult, error)

ExecuteTransactions header - the header of the rollup where this transaction will be included fromTxIndex - for the receipts and events, the evm needs to know for each transaction the order in which it was executed in the block.

func MaskedSender added in v0.28.0

func MaskedSender(address gethcommon.Address) gethcommon.Address

func TransactionToMessageNoSender added in v0.28.0

func TransactionToMessageNoSender(tx *types.Transaction, baseFee *big.Int) *core.Message

func TransactionToMessageWithOverrides added in v0.28.0

func TransactionToMessageWithOverrides(
	tx *common.L2PricedTransaction,
	config *params.ChainConfig,
	header *types.Header,
) (*core.Message, error)

TransactionToMessageWithOverrides is used to convert a transaction to a message to be applied to the evm. Overrides can change how stuff in the message is derived, e.g. the sender. This is useful for synthetic transactions, where we do not want to do signature validation or have a private key.

Types

type ContractTransparencyConfigEventLogConfig added in v0.28.0

type ContractTransparencyConfigEventLogConfig struct {
	EventSignature common.Hash
	VisibleTo      []uint8
}

ContractTransparencyConfigEventLogConfig is an auto generated low-level Go binding around an user-defined struct.

type ContractTransparencyConfigVisibilityConfig added in v0.28.0

type ContractTransparencyConfigVisibilityConfig struct {
	ContractCfg     uint8
	EventLogConfigs []ContractTransparencyConfigEventLogConfig
}

ContractTransparencyConfigVisibilityConfig is an auto generated low-level Go binding around an user-defined struct.

type ObscuroChainContext

type ObscuroChainContext struct {
	// contains filtered or unexported fields
}

ObscuroChainContext - basic implementation of the ChainContext needed for the EVM integration

func NewObscuroChainContext

func NewObscuroChainContext(storage storage.Storage, gethEncodingService gethencoding.EncodingService, config enclaveconfig.EnclaveConfig, logger gethlog.Logger) *ObscuroChainContext

NewObscuroChainContext returns a new instance of the ObscuroChainContext given a storage ( and logger )

func (*ObscuroChainContext) Engine

func (occ *ObscuroChainContext) Engine() consensus.Engine

func (*ObscuroChainContext) GetHeader

func (occ *ObscuroChainContext) GetHeader(hash common.Hash, _ uint64) *types.Header

type ObscuroNoOpConsensusEngine

type ObscuroNoOpConsensusEngine struct {
	// contains filtered or unexported fields
}

ObscuroNoOpConsensusEngine - implements the geth consensus.Engine, but doesn't do anything This is needed for running evm transactions

func (*ObscuroNoOpConsensusEngine) APIs

func (*ObscuroNoOpConsensusEngine) Author

Author is used to determine where to send the gas collected from the fees.

func (*ObscuroNoOpConsensusEngine) CalcDifficulty

func (*ObscuroNoOpConsensusEngine) Close

func (e *ObscuroNoOpConsensusEngine) Close() error

func (*ObscuroNoOpConsensusEngine) Finalize

func (*ObscuroNoOpConsensusEngine) FinalizeAndAssemble

func (*ObscuroNoOpConsensusEngine) Prepare

func (*ObscuroNoOpConsensusEngine) Seal

func (e *ObscuroNoOpConsensusEngine) Seal(_ consensus.ChainHeaderReader, _ *types.Block, _ chan<- *types.Block, _ <-chan struct{}) error

func (*ObscuroNoOpConsensusEngine) SealHash

func (*ObscuroNoOpConsensusEngine) VerifyHeader

func (*ObscuroNoOpConsensusEngine) VerifyHeaders

func (e *ObscuroNoOpConsensusEngine) VerifyHeaders(_ consensus.ChainHeaderReader, _ []*types.Header) (chan<- struct{}, <-chan error)

func (*ObscuroNoOpConsensusEngine) VerifyUncles

type TransparencyConfig added in v0.28.0

type TransparencyConfig struct {
	TransparencyConfigCaller // Read-only binding to the contract
}

TransparencyConfig is an auto generated Go binding around an Ethereum contract.

type TransparencyConfigCaller added in v0.28.0

type TransparencyConfigCaller struct {
	// contains filtered or unexported fields
}

TransparencyConfigCaller is an auto generated read-only Go binding around an Ethereum contract.

func NewTransparencyConfigCaller added in v0.28.0

func NewTransparencyConfigCaller(address common.Address, caller bind.ContractCaller) (*TransparencyConfigCaller, error)

NewTransparencyConfigCaller creates a new read-only instance of TransparencyConfig, bound to a specific deployed contract.

func (*TransparencyConfigCaller) VisibilityRules added in v0.28.0

func (_ContractTransp *TransparencyConfigCaller) VisibilityRules(opts *bind.CallOpts) (ContractTransparencyConfigVisibilityConfig, error)

VisibilityRules is a free data retrieval call binding the contract method 0x30173dd1.

Solidity: function visibilityRules() pure returns((bool,(bytes,bool,bool,bool,bool,bool)[]))

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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