itc

package
v1.10.3 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: LGPL-3.0 Imports: 53 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BloomBitsBlocks is the number of blocks a single bloom bit section vector
	// contains on the server side.
	BloomBitsBlocks uint64 = 4096
)

Variables

View Source
var DefaultGPOConfig = intelchain.GasPriceOracleConfig{
	Blocks:            20,
	Transactions:      3,
	Percentile:        60,
	DefaultPrice:      100 * denominations.Intello,
	MaxPrice:          1000 * denominations.Intello,
	LowUsageThreshold: 50,
	BlockGasLimit:     0,
}
View Source
var (
	// ErrFinalizedTransaction is returned if the transaction to be submitted is already on-chain
	ErrFinalizedTransaction = errors.New("transaction already finalized")
)

Functions

func NewBloomIndexer

func NewBloomIndexer(db core.Chain, size, confirms uint64) *core.ChainIndexer

NewBloomIndexer returns a chain indexer that generates bloom bits data for the canonical chain for fast logs filtering.

Types

type BloomIndexer

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

BloomIndexer implements a core.ChainIndexer, building up a rotated bloom bits index for the Ethereum header bloom filters, permitting blazing fast filtering.

func (*BloomIndexer) Commit

func (b *BloomIndexer) Commit() error

Commit implements core.ChainIndexerBackend, finalizing the bloom section and writing it out into the database.

func (*BloomIndexer) Process

func (b *BloomIndexer) Process(ctx context.Context, header *block.Header) error

Process implements core.ChainIndexerBackend, adding a new header's bloom into the index.

func (*BloomIndexer) Reset

func (b *BloomIndexer) Reset(ctx context.Context, section uint64, lastSectionHead common.Hash) error

Reset implements core.ChainIndexerBackend, starting a new bloombits index section.

type DetailedBlockSignerInfo

type DetailedBlockSignerInfo struct {
	// Signers are all the signers for the block
	Signers shard.SlotList
	// Committee when the block was signed.
	Committee shard.SlotList
	BlockHash common.Hash
}

DetailedBlockSignerInfo contains all of the block singing information

type ExecutionResult

type ExecutionResult struct {
	Gas         uint64         `json:"gas"`
	Failed      bool           `json:"failed"`
	ReturnValue string         `json:"returnValue"`
	StructLogs  []StructLogRes `json:"structLogs"`
}

ExecutionResult groups all structured logs emitted by the EVM while replaying a transaction in debug mode as well as transaction execution status, the amount of gas used and the return value Taken from go-ethereum/internal/ethapi/api.go

type Intelchain

type Intelchain struct {
	// Channel for shutting down the service
	ShutdownChan  chan bool                      // Channel for shutting down the Intelchain
	BloomRequests chan chan *bloombits.Retrieval // Channel receiving bloom data retrieval requests
	BlockChain    core.BlockChain
	BeaconChain   core.BlockChain
	TxPool        *core.TxPool
	CxPool        *core.CxPool // CxPool is used to store the blockHashes of blocks containing cx receipts to be sent
	// DB interfaces
	BloomIndexer *core.ChainIndexer // Bloom indexer operating during block imports
	NodeAPI      NodeAPI
	// ChainID is used to identify which network we are using
	ChainID uint64
	// EthCompatibleChainID is used to identify the Ethereum compatible chain ID
	EthChainID uint64
	// RPCGasCap is the global gas cap for eth-call variants.
	RPCGasCap *big.Int `toml:",omitempty"`
	ShardID   uint32
	// contains filtered or unexported fields
}

Intelchain implements the Intelchain full node service.

func New

func New(
	nodeAPI NodeAPI, txPool *core.TxPool, cxPool *core.CxPool, shardID uint32,
) *Intelchain

New creates a new Intelchain object (including the initialisation of the common Intelchain object)

func (*Intelchain) BlockByNumber

func (itc *Intelchain) BlockByNumber(ctx context.Context, blockNum rpc.BlockNumber) (*types.Block, error)

BlockByNumber ...

func (*Intelchain) BlockByNumberOrHash

func (itc *Intelchain) BlockByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Block, error)

func (*Intelchain) BloomStatus

func (itc *Intelchain) BloomStatus() (uint64, uint64)

BloomStatus ... TODO: this is not implemented or verified yet for intelchain.

func (*Intelchain) ChainConfig

func (itc *Intelchain) ChainConfig() *params.ChainConfig

ChainConfig ...

func (*Intelchain) ChainDb

func (itc *Intelchain) ChainDb() ethdb.Database

ChainDb ..

func (*Intelchain) ComputeStateDB

func (itc *Intelchain) ComputeStateDB(block *types.Block, reexec uint64) (*state.DB, error)

ComputeStateDB retrieves the state database associated with a certain block. If no state is locally available for the given block, a number of blocks are attempted to be reexecuted to generate the desired state.

func (*Intelchain) ComputeTxEnv

func (itc *Intelchain) ComputeTxEnv(block *types.Block, txIndex int, reexec uint64) (core.Message, vm.Context, *state.DB, error)

ComputeTxEnv returns the execution environment of a certain transaction.

func (*Intelchain) ComputeTxEnvEachBlockWithoutApply

func (itc *Intelchain) ComputeTxEnvEachBlockWithoutApply(block *types.Block, reexec uint64, cb func(int, *types.Transaction, core.Message, vm.Context, *state.DB) bool) error

ComputeTxEnvEachBlockWithoutApply returns the execution environment of a certain transaction.

func (*Intelchain) CurrentBlock

func (itc *Intelchain) CurrentBlock() *types.Block

CurrentBlock ...

func (*Intelchain) CurrentHeader

func (itc *Intelchain) CurrentHeader() *block.Header

CurrentHeader returns the current header from the local chain.

func (*Intelchain) EventMux

func (itc *Intelchain) EventMux() *event.TypeMux

EventMux ..

func (*Intelchain) GetAccountNonce

func (itc *Intelchain) GetAccountNonce(
	ctx context.Context, address common.Address, blockNum rpc.BlockNumber) (uint64, error)

GetAccountNonce returns the nonce value of the given address for the given block number

func (*Intelchain) GetAllValidatorAddresses

func (itc *Intelchain) GetAllValidatorAddresses() []common.Address

GetAllValidatorAddresses returns the up to date validator candidates for next epoch

func (*Intelchain) GetBalance

func (itc *Intelchain) GetBalance(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (*big.Int, error)

GetBalance returns balance of an given address.

func (*Intelchain) GetBlock

func (itc *Intelchain) GetBlock(ctx context.Context, hash common.Hash) (*types.Block, error)

GetBlock returns block by hash.

func (*Intelchain) GetBlockSigners

func (itc *Intelchain) GetBlockSigners(
	ctx context.Context, blockNum rpc.BlockNumber,
) (shard.SlotList, *internal_bls.Mask, error)

GetBlockSigners ..

func (*Intelchain) GetCurrentBadBlocks

func (itc *Intelchain) GetCurrentBadBlocks() []core.BadBlock

GetCurrentBadBlocks ..

func (*Intelchain) GetCurrentStakingErrorSink

func (itc *Intelchain) GetCurrentStakingErrorSink() types.TransactionErrorReports

GetCurrentStakingErrorSink ..

func (*Intelchain) GetCurrentTransactionErrorSink

func (itc *Intelchain) GetCurrentTransactionErrorSink() types.TransactionErrorReports

GetCurrentTransactionErrorSink ..

func (*Intelchain) GetCurrentUtilityMetrics

func (itc *Intelchain) GetCurrentUtilityMetrics() (*network.UtilityMetric, error)

GetCurrentUtilityMetrics ..

func (*Intelchain) GetDelegationLockingPeriodInEpoch

func (itc *Intelchain) GetDelegationLockingPeriodInEpoch(epoch *big.Int) int

GetDelegationLockingPeriodInEpoch ...

func (*Intelchain) GetDelegationsByDelegator

func (itc *Intelchain) GetDelegationsByDelegator(
	delegator common.Address,
) ([]common.Address, []*staking.Delegation)

GetDelegationsByDelegator returns all delegation information of a delegator

func (*Intelchain) GetDelegationsByDelegatorByBlock

func (itc *Intelchain) GetDelegationsByDelegatorByBlock(
	delegator common.Address, block *types.Block,
) ([]common.Address, []*staking.Delegation)

GetDelegationsByDelegatorByBlock returns all delegation information of a delegator

func (*Intelchain) GetDelegationsByValidator

func (itc *Intelchain) GetDelegationsByValidator(validator common.Address) []staking.Delegation

GetDelegationsByValidator returns all delegation information of a validator

func (*Intelchain) GetDelegationsByValidatorAtBlock

func (itc *Intelchain) GetDelegationsByValidatorAtBlock(
	validator common.Address, block *types.Block,
) []staking.Delegation

GetDelegationsByValidatorAtBlock returns all delegation information of a validator at the given block

func (*Intelchain) GetDetailedBlockSignerInfo

func (itc *Intelchain) GetDetailedBlockSignerInfo(
	ctx context.Context, blk *types.Block,
) (*DetailedBlockSignerInfo, error)

GetDetailedBlockSignerInfo fetches the block signer information for any non-genesis block

func (*Intelchain) GetEVM

func (itc *Intelchain) GetEVM(ctx context.Context, msg core.Message, state *state.DB, header *block.Header) (*vm.EVM, error)

GetEVM returns a new EVM entity

func (*Intelchain) GetElectedValidatorAddresses

func (itc *Intelchain) GetElectedValidatorAddresses() []common.Address

GetElectedValidatorAddresses returns the address of elected validators for current epoch

func (*Intelchain) GetHeader

func (itc *Intelchain) GetHeader(ctx context.Context, hash common.Hash) (*block.Header, error)

GetHeader returns header by hash.

func (itc *Intelchain) GetLastCrossLinks() ([]*types.CrossLink, error)

GetLastCrossLinks ..

func (*Intelchain) GetLatestChainHeaders

func (itc *Intelchain) GetLatestChainHeaders() *block.HeaderPair

GetLatestChainHeaders ..

func (*Intelchain) GetLeaderAddress

func (itc *Intelchain) GetLeaderAddress(coinbaseAddr common.Address, epoch *big.Int) string

GetLeaderAddress returns the one address of the leader, given the coinbaseAddr. Note that the coinbaseAddr is overloaded with the BLS pub key hash in staking era.

func (*Intelchain) GetLogs

func (itc *Intelchain) GetLogs(ctx context.Context, blockHash common.Hash, isEth bool) ([][]*types.Log, error)

GetLogs ...

func (*Intelchain) GetMedianRawStakeSnapshot

func (itc *Intelchain) GetMedianRawStakeSnapshot() (
	*committee.CompletedEPoSRound, error,
)

GetMedianRawStakeSnapshot ..

func (*Intelchain) GetNodeMetadata

func (itc *Intelchain) GetNodeMetadata() commonRPC.NodeMetadata

GetNodeMetadata returns the node metadata.

func (*Intelchain) GetPeerInfo

func (itc *Intelchain) GetPeerInfo() commonRPC.NodePeerInfo

GetPeerInfo returns the peer info to the node, including blocked peer, connected peer, number of peers

func (*Intelchain) GetPendingCXReceipts

func (itc *Intelchain) GetPendingCXReceipts() []*types.CXReceiptsProof

GetPendingCXReceipts ..

func (*Intelchain) GetPoolNonce

func (itc *Intelchain) GetPoolNonce(ctx context.Context, addr common.Address) (uint64, error)

GetPoolNonce ...

func (*Intelchain) GetPoolStats

func (itc *Intelchain) GetPoolStats() (pendingCount, queuedCount int)

GetPoolStats returns the number of pending and queued transactions

func (*Intelchain) GetPoolTransaction

func (itc *Intelchain) GetPoolTransaction(hash common.Hash) types.PoolTransaction

GetPoolTransaction ...

func (*Intelchain) GetPoolTransactions

func (itc *Intelchain) GetPoolTransactions() (types.PoolTransactions, error)

GetPoolTransactions returns pool transactions.

func (*Intelchain) GetPreStakingBlockRewards

func (itc *Intelchain) GetPreStakingBlockRewards(
	ctx context.Context, blk *types.Block,
) (PreStakingBlockRewards, error)

GetPreStakingBlockRewards for the given block number. Calculated rewards are done exactly like chain.AccumulateRewardsAndCountSigs.

func (*Intelchain) GetReceipts

func (itc *Intelchain) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error)

GetReceipts ...

func (*Intelchain) GetShardState

func (itc *Intelchain) GetShardState() (*shard.State, error)

GetShardState ...

func (*Intelchain) GetStakingTransactionsCount

func (itc *Intelchain) GetStakingTransactionsCount(address, txType string) (uint64, error)

GetStakingTransactionsCount returns the number of staking transactions of address.

func (*Intelchain) GetStakingTransactionsHistory

func (itc *Intelchain) GetStakingTransactionsHistory(address, txType, order string) ([]common.Hash, error)

GetStakingTransactionsHistory returns list of staking transactions hashes of address.

func (*Intelchain) GetSuperCommittees

func (itc *Intelchain) GetSuperCommittees() (*quorum.Transition, error)

GetSuperCommittees ..

func (*Intelchain) GetTotalStakingSnapshot

func (itc *Intelchain) GetTotalStakingSnapshot() *big.Int

GetTotalStakingSnapshot ..

func (*Intelchain) GetTransactionsCount

func (itc *Intelchain) GetTransactionsCount(address, txType string) (uint64, error)

GetTransactionsCount returns the number of regular transactions of address.

func (*Intelchain) GetTransactionsHistory

func (itc *Intelchain) GetTransactionsHistory(address, txType, order string) ([]common.Hash, error)

GetTransactionsHistory returns list of transactions hashes of address.

func (*Intelchain) GetUndelegationPayouts

func (itc *Intelchain) GetUndelegationPayouts(
	ctx context.Context, epoch *big.Int,
) (*UndelegationPayouts, error)

GetUndelegationPayouts returns the undelegation payouts for each delegator

Due to in-memory caching, it is possible to get undelegation payouts for a state / epoch that has been pruned but have it be lost (and unable to recompute) after the node restarts. This not a problem if a full (archival) DB is used.

func (*Intelchain) GetValidatorInformation

func (itc *Intelchain) GetValidatorInformation(
	addr common.Address, block *types.Block,
) (*staking.ValidatorRPCEnhanced, error)

GetValidatorInformation returns the information of validator

func (*Intelchain) GetValidatorSelfDelegation

func (itc *Intelchain) GetValidatorSelfDelegation(addr common.Address) *big.Int

GetValidatorSelfDelegation returns the amount of staking after applying all delegated stakes

func (*Intelchain) GetValidators

func (itc *Intelchain) GetValidators(epoch *big.Int) (*shard.Committee, error)

GetValidators returns validators for a particular epoch.

func (*Intelchain) GetValidatorsStakeByBlockNumber

func (itc *Intelchain) GetValidatorsStakeByBlockNumber(
	block *types.Block,
) (map[string]*big.Int, error)

func (*Intelchain) HeaderByHash

func (itc *Intelchain) HeaderByHash(ctx context.Context, blockHash common.Hash) (*block.Header, error)

HeaderByHash ...

func (*Intelchain) HeaderByNumber

func (itc *Intelchain) HeaderByNumber(ctx context.Context, blockNum rpc.BlockNumber) (*block.Header, error)

HeaderByNumber ...

func (*Intelchain) IsCommitteeSelectionBlock

func (itc *Intelchain) IsCommitteeSelectionBlock(header *block.Header) bool

IsCommitteeSelectionBlock checks if the given block is the committee selection block

func (*Intelchain) IsLeader

func (itc *Intelchain) IsLeader() bool

IsLeader exposes if node is currently leader.

func (*Intelchain) IsMaxRate

func (itc *Intelchain) IsMaxRate(epoch *big.Int) bool

IsMaxRate ...

func (*Intelchain) IsNoEarlyUnlockEpoch

func (itc *Intelchain) IsNoEarlyUnlockEpoch(epoch *big.Int) bool

IsNoEarlyUnlockEpoch ...

func (*Intelchain) IsPreStakingEpoch

func (itc *Intelchain) IsPreStakingEpoch(epoch *big.Int) bool

IsPreStakingEpoch ...

func (*Intelchain) IsStakingEpoch

func (itc *Intelchain) IsStakingEpoch(epoch *big.Int) bool

IsStakingEpoch ...

func (*Intelchain) ProtocolVersion

func (itc *Intelchain) ProtocolVersion() int

ProtocolVersion ...

func (*Intelchain) ResendCx

func (itc *Intelchain) ResendCx(ctx context.Context, txID common.Hash) (uint64, bool)

ResendCx retrieve blockHash from txID and add blockHash to CxPool for resending Note that cross shard txn is only for regular txns, not for staking txns, so the input txn hash is expected to be regular txn hash

func (*Intelchain) SendStakingTx

func (itc *Intelchain) SendStakingTx(ctx context.Context, signedStakingTx *staking.StakingTransaction) error

SendStakingTx adds a staking transaction

func (*Intelchain) SendTx

func (itc *Intelchain) SendTx(ctx context.Context, signedTx *types.Transaction) error

SendTx ...

func (*Intelchain) ServiceFilter

func (itc *Intelchain) ServiceFilter(ctx context.Context, session *bloombits.MatcherSession)

ServiceFilter ...

func (*Intelchain) SingleFlightForgetKey

func (itc *Intelchain) SingleFlightForgetKey(key string)

SingleFlightForgetKey ...

func (*Intelchain) SingleFlightRequest

func (itc *Intelchain) SingleFlightRequest(
	key string,
	fn func() (interface{}, error),
) (interface{}, error)

SingleFlightRequest ..

func (*Intelchain) StateAndHeaderByNumber

func (itc *Intelchain) StateAndHeaderByNumber(ctx context.Context, blockNum rpc.BlockNumber) (*state.DB, *block.Header, error)

StateAndHeaderByNumber ...

func (*Intelchain) StateAndHeaderByNumberOrHash

func (itc *Intelchain) StateAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*state.DB, *block.Header, error)

func (*Intelchain) SubscribeChainEvent

func (itc *Intelchain) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription

SubscribeChainEvent subscribes chain event. TODO: this is not implemented or verified yet for intelchain.

func (*Intelchain) SubscribeChainHeadEvent

func (itc *Intelchain) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription

SubscribeChainHeadEvent subcribes chain head event. TODO: this is not implemented or verified yet for intelchain.

func (*Intelchain) SubscribeChainSideEvent

func (itc *Intelchain) SubscribeChainSideEvent(ch chan<- core.ChainSideEvent) event.Subscription

SubscribeChainSideEvent subcribes chain side event. TODO: this is not implemented or verified yet for intelchain.

func (*Intelchain) SubscribeLogsEvent

func (itc *Intelchain) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription

SubscribeLogsEvent subcribes log event. TODO: this is not implemented or verified yet for intelchain.

func (*Intelchain) SubscribeNewTxsEvent

func (itc *Intelchain) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.Subscription

SubscribeNewTxsEvent subscribes new tx event. TODO: this is not implemented or verified yet for intelchain.

func (*Intelchain) SubscribeRemovedLogsEvent

func (itc *Intelchain) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription

SubscribeRemovedLogsEvent subcribes removed logs event. TODO: this is not implemented or verified yet for intelchain.

func (*Intelchain) SuggestPrice

func (itc *Intelchain) SuggestPrice(ctx context.Context) (*big.Int, error)

func (*Intelchain) TraceBlock

func (itc *Intelchain) TraceBlock(ctx context.Context, block *types.Block, config *TraceConfig) ([]*TxTraceResult, error)

TraceBlock configures a new tracer according to the provided configuration, and executes all the transactions contained within. The return value will be one item per transaction, dependent on the requested tracer.

func (*Intelchain) TraceChain

func (itc *Intelchain) TraceChain(ctx context.Context, start, end *types.Block, config *TraceConfig) (*rpc.Subscription, error)

TraceChain configures a new tracer according to the provided configuration, and executes all the transactions contained within. The return value will be one item per transaction, dependent on the requested tracer.

func (*Intelchain) TraceTx

func (itc *Intelchain) TraceTx(ctx context.Context, message core.Message, vmctx vm.Context, statedb *state.DB, config *TraceConfig) (interface{}, error)

TraceTx configures a new tracer according to the provided configuration, and executes the given message in the provided environment. The return value will be tracer dependent. NOTE: Only support default StructLogger tracer

type NodeAPI

type NodeAPI interface {
	AddPendingStakingTransaction(*staking.StakingTransaction) error
	AddPendingTransaction(newTx *types.Transaction) error
	Blockchain() core.BlockChain
	Beaconchain() core.BlockChain
	GetTransactionsHistory(address, txType, order string) ([]common.Hash, error)
	GetStakingTransactionsHistory(address, txType, order string) ([]common.Hash, error)
	GetTransactionsCount(address, txType string) (uint64, error)
	GetStakingTransactionsCount(address, txType string) (uint64, error)
	GetTraceResultByHash(hash common.Hash) (json.RawMessage, error)
	IsCurrentlyLeader() bool
	IsOutOfSync(shardID uint32) bool
	SyncStatus(shardID uint32) (bool, uint64, uint64)
	SyncPeers() map[string]int
	ReportStakingErrorSink() types.TransactionErrorReports
	ReportPlainErrorSink() types.TransactionErrorReports
	PendingCXReceipts() []*types.CXReceiptsProof
	GetNodeBootTime() int64
	PeerConnectivity() (int, int, int)
	ListPeer(topic string) []peer.ID
	ListTopic() []string
	ListBlockedPeer() []peer.ID

	GetConsensusInternal() commonRPC.ConsensusInternal
	IsBackup() bool
	SetNodeBackupMode(isBackup bool) bool

	// debug API
	GetConsensusMode() string
	GetConsensusPhase() string
	GetConsensusViewChangingID() uint64
	GetConsensusCurViewID() uint64
	GetConfig() commonRPC.Config
	ShutDown()
	GetLastSigningPower() (float64, error)
	GetLastSigningPower2() (float64, error)
}

NodeAPI is the list of functions from node used to call rpc apis.

type Oracle

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

Oracle recommends gas prices based on the content of recent blocks.

func NewOracle

func NewOracle(backend *Intelchain, params *intelchain.GasPriceOracleConfig) *Oracle

NewOracle returns a new gasprice oracle which can recommend suitable gasprice for newly created transaction.

func (*Oracle) SuggestPrice

func (gpo *Oracle) SuggestPrice(ctx context.Context) (*big.Int, error)

SuggestPrice returns a gasprice so that newly created transaction can have a very high chance to be included in the following blocks.

type OracleBackend

type OracleBackend interface {
	HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*block.Header, error)
	BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error)
	ChainConfig() *params.ChainConfig
}

OracleBackend includes all necessary background APIs for oracle.

type PreStakingBlockRewards

type PreStakingBlockRewards map[common.Address]*big.Int

PreStakingBlockRewards are the rewards for a block in the pre-staking era (epoch < staking epoch).

type StdTraceConfig

type StdTraceConfig struct {
	*vm.LogConfig
	Reexec *uint64
	TxHash common.Hash
}

StdTraceConfig holds extra parameters to standard-json trace functions.

type StructLogRes

type StructLogRes struct {
	Pc              uint64            `json:"pc"`
	Op              string            `json:"op"`
	CallerAddress   common.Address    `json:"callerAddress"`
	ContractAddress common.Address    `json:"contractAddress"`
	Gas             uint64            `json:"gas"`
	GasCost         uint64            `json:"gasCost"`
	Depth           int               `json:"depth"`
	Error           error             `json:"error,omitempty"`
	Stack           []string          `json:"stack,omitempty"`
	AfterStack      []string          `json:"afterStack,omitempty"`
	Memory          []string          `json:"memory,omitempty"`
	Storage         map[string]string `json:"storage,omitempty"`
	// contains filtered or unexported fields
}

StructLogRes stores a structured log emitted by the EVM while replaying a transaction in debug mode

func FormatLogs

func FormatLogs(logs []*vm.StructLog, conf *TraceConfig) []StructLogRes

FormatLogs formats EVM returned structured logs for json output

func (*StructLogRes) FormatAfterStack

func (r *StructLogRes) FormatAfterStack() []string

func (*StructLogRes) FormatMemory

func (r *StructLogRes) FormatMemory() []string

func (*StructLogRes) FormatStack

func (r *StructLogRes) FormatStack() []string

func (*StructLogRes) FormatStorage

func (r *StructLogRes) FormatStorage() map[string]string

func (*StructLogRes) GetOperatorEvent

func (r *StructLogRes) GetOperatorEvent(key string) string

type TraceConfig

type TraceConfig struct {
	*vm.LogConfig
	Tracer  *string
	Timeout *string
	Reexec  *uint64
}

TraceConfig holds extra parameters to trace functions.

type TxTraceResult

type TxTraceResult struct {
	Result interface{} `json:"result,omitempty"` // Trace results produced by the tracer
	Error  string      `json:"error,omitempty"`  // Trace failure produced by the tracer
}

TxTraceResult is the result of a single transaction trace.

type UndelegationPayouts

type UndelegationPayouts struct {
	Data map[common.Address]map[common.Address]*big.Int
}

UndelegationPayouts ..

func NewUndelegationPayouts

func NewUndelegationPayouts() *UndelegationPayouts

func (*UndelegationPayouts) SetPayoutByDelegatorAddrAndValidatorAddr

func (u *UndelegationPayouts) SetPayoutByDelegatorAddrAndValidatorAddr(
	delegator, validator common.Address, amount *big.Int,
)

Directories

Path Synopsis
Package tracers is a collection of JavaScript transaction tracers.
Package tracers is a collection of JavaScript transaction tracers.
internal/tracers
Package tracers contains the actual JavaScript tracer assets.
Package tracers contains the actual JavaScript tracer assets.

Jump to

Keyboard shortcuts

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