arbitrum

package
v0.0.0-...-a2792d4 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: GPL-3.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	RPCGasCap:               ethconfig.Defaults.RPCGasCap,
	RPCTxFeeCap:             ethconfig.Defaults.RPCTxFeeCap,
	RPCEVMTimeout:           ethconfig.Defaults.RPCEVMTimeout,
	BloomBitsBlocks:         params.BloomBitsBlocks * 4,
	BloomConfirms:           params.BloomConfirms,
	FilterLogCacheSize:      32,
	FilterTimeout:           5 * time.Minute,
	FeeHistoryMaxBlockCount: 1024,
	ClassicRedirect:         "",
	ArbDebug: ArbDebugConfig{
		BlockRangeBound:   256,
		TimeoutQueueBound: 512,
	},
}

Functions

func ConfigAddOptions

func ConfigAddOptions(prefix string, f *flag.FlagSet)

func CreateFallbackClient

func CreateFallbackClient(fallbackClientUrl string, fallbackClientTimeout time.Duration) (types.FallbackClient, error)

func EstimateGas

func EstimateGas(ctx context.Context, b ethapi.Backend, args TransactionArgs, blockNrOrHash rpc.BlockNumberOrHash, gasCap uint64) (hexutil.Uint64, error)

func NewRevertReason

func NewRevertReason(result *core.ExecutionResult) error

Types

type APIBackend

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

func (*APIBackend) AccountManager

func (a *APIBackend) AccountManager() *accounts.Manager

func (*APIBackend) BlockByHash

func (a *APIBackend) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)

func (*APIBackend) BlockByNumber

func (a *APIBackend) BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error)

func (*APIBackend) BlockByNumberOrHash

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

func (*APIBackend) BloomStatus

func (a *APIBackend) BloomStatus() (uint64, uint64)

Filter API

func (*APIBackend) ChainConfig

func (a *APIBackend) ChainConfig() *params.ChainConfig

func (*APIBackend) ChainDb

func (a *APIBackend) ChainDb() ethdb.Database

func (*APIBackend) CurrentBlock

func (a *APIBackend) CurrentBlock() *types.Block

func (*APIBackend) CurrentHeader

func (a *APIBackend) CurrentHeader() *types.Header

func (*APIBackend) Engine

func (a *APIBackend) Engine() consensus.Engine

func (*APIBackend) ExtRPCEnabled

func (a *APIBackend) ExtRPCEnabled() bool

func (*APIBackend) FallbackClient

func (b *APIBackend) FallbackClient() types.FallbackClient

func (*APIBackend) FeeHistory

func (a *APIBackend) FeeHistory(
	ctx context.Context,
	blocks int,
	newestBlock rpc.BlockNumber,
	rewardPercentiles []float64,
) (*big.Int, [][]*big.Int, []*big.Int, []float64, error)

func (*APIBackend) GetAPIs

func (a *APIBackend) GetAPIs(filterSystem *filters.FilterSystem) []rpc.API

func (*APIBackend) GetArbitrumNode

func (a *APIBackend) GetArbitrumNode() interface{}

func (*APIBackend) GetEVM

func (a *APIBackend) GetEVM(ctx context.Context, msg core.Message, state *state.StateDB, header *types.Header, vmConfig *vm.Config) (*vm.EVM, func() error, error)

func (*APIBackend) GetLogs

func (a *APIBackend) GetLogs(ctx context.Context, hash common.Hash, number uint64) ([][]*types.Log, error)

func (*APIBackend) GetPoolNonce

func (a *APIBackend) GetPoolNonce(ctx context.Context, addr common.Address) (uint64, error)

func (*APIBackend) GetPoolTransaction

func (a *APIBackend) GetPoolTransaction(txHash common.Hash) *types.Transaction

func (*APIBackend) GetPoolTransactions

func (a *APIBackend) GetPoolTransactions() (types.Transactions, error)

func (*APIBackend) GetReceipts

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

func (*APIBackend) GetTd

func (a *APIBackend) GetTd(ctx context.Context, hash common.Hash) *big.Int

func (*APIBackend) GetTransaction

func (a *APIBackend) GetTransaction(ctx context.Context, txHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error)

func (*APIBackend) HeaderByHash

func (a *APIBackend) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)

func (*APIBackend) HeaderByNumber

func (a *APIBackend) HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Header, error)

func (*APIBackend) HeaderByNumberOrHash

func (a *APIBackend) HeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Header, error)

func (*APIBackend) PendingBlockAndReceipts

func (b *APIBackend) PendingBlockAndReceipts() (*types.Block, types.Receipts)

func (*APIBackend) RPCEVMTimeout

func (a *APIBackend) RPCEVMTimeout() time.Duration

func (*APIBackend) RPCGasCap

func (a *APIBackend) RPCGasCap() uint64

func (*APIBackend) RPCTxFeeCap

func (a *APIBackend) RPCTxFeeCap() float64

func (*APIBackend) SendTx

func (a *APIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error

Transaction pool API

func (*APIBackend) ServiceFilter

func (a *APIBackend) ServiceFilter(ctx context.Context, session *bloombits.MatcherSession)

func (*APIBackend) SetHead

func (a *APIBackend) SetHead(number uint64)

Blockchain API

func (*APIBackend) StateAndHeaderByNumber

func (a *APIBackend) StateAndHeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*state.StateDB, *types.Header, error)

func (*APIBackend) StateAndHeaderByNumberOrHash

func (a *APIBackend) StateAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*state.StateDB, *types.Header, error)

func (*APIBackend) StateAtBlock

func (a *APIBackend) StateAtBlock(ctx context.Context, block *types.Block, reexec uint64, base *state.StateDB, checkLive bool, preferDisk bool) (statedb *state.StateDB, err error)

func (*APIBackend) StateAtTransaction

func (a *APIBackend) StateAtTransaction(ctx context.Context, block *types.Block, txIndex int, reexec uint64) (core.Message, vm.BlockContext, *state.StateDB, error)

func (*APIBackend) Stats

func (a *APIBackend) Stats() (pending int, queued int)

func (*APIBackend) SubscribeChainEvent

func (a *APIBackend) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription

func (*APIBackend) SubscribeChainHeadEvent

func (a *APIBackend) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription

func (*APIBackend) SubscribeChainSideEvent

func (a *APIBackend) SubscribeChainSideEvent(ch chan<- core.ChainSideEvent) event.Subscription

func (*APIBackend) SubscribeLogsEvent

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

func (*APIBackend) SubscribeNewTxsEvent

func (a *APIBackend) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.Subscription

func (*APIBackend) SubscribePendingLogsEvent

func (a *APIBackend) SubscribePendingLogsEvent(ch chan<- []*types.Log) event.Subscription

func (*APIBackend) SubscribeRemovedLogsEvent

func (a *APIBackend) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription

func (*APIBackend) SuggestGasTipCap

func (a *APIBackend) SuggestGasTipCap(ctx context.Context) (*big.Int, error)

func (*APIBackend) SyncProgress

func (a *APIBackend) SyncProgress() ethereum.SyncProgress

func (*APIBackend) SyncProgressMap

func (a *APIBackend) SyncProgressMap() map[string]interface{}

General Ethereum API

func (*APIBackend) TxPoolContent

func (a *APIBackend) TxPoolContent() (map[common.Address]types.Transactions, map[common.Address]types.Transactions)

func (*APIBackend) TxPoolContentFrom

func (a *APIBackend) TxPoolContentFrom(addr common.Address) (types.Transactions, types.Transactions)

func (*APIBackend) UnprotectedAllowed

func (a *APIBackend) UnprotectedAllowed() bool

type ArbDebugConfig

type ArbDebugConfig struct {
	BlockRangeBound   uint64 `koanf:"block-range-bound"`
	TimeoutQueueBound uint64 `koanf:"timeout-queue-bound"`
}

type ArbInterface

type ArbInterface interface {
	PublishTransaction(ctx context.Context, tx *types.Transaction) error
	BlockChain() *core.BlockChain
	ArbNode() interface{}
}

type Backend

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

func NewBackend

func NewBackend(stack *node.Node, config *Config, chainDb ethdb.Database, publisher ArbInterface, sync SyncProgressBackend, filterConfig filters.Config) (*Backend, *filters.FilterSystem, error)

func (*Backend) APIBackend

func (b *Backend) APIBackend() *APIBackend

func (*Backend) ArbInterface

func (b *Backend) ArbInterface() ArbInterface

func (*Backend) ChainDb

func (b *Backend) ChainDb() ethdb.Database

func (*Backend) EnqueueL2Message

func (b *Backend) EnqueueL2Message(ctx context.Context, tx *types.Transaction) error

func (*Backend) Stack

func (b *Backend) Stack() *node.Node

func (*Backend) Start

func (b *Backend) Start() error

TODO: this is used when registering backend as lifecycle in stack

func (*Backend) Stop

func (b *Backend) Stop() error

func (*Backend) SubscribeNewTxsEvent

func (b *Backend) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.Subscription

type Config

type Config struct {
	// RPCGasCap is the global gas cap for eth-call variants.
	RPCGasCap uint64 `koanf:"gas-cap"`

	// RPCTxFeeCap is the global transaction fee(price * gaslimit) cap for
	// send-transction variants. The unit is ether.
	RPCTxFeeCap float64 `koanf:"tx-fee-cap"`

	// RPCEVMTimeout is the global timeout for eth-call.
	RPCEVMTimeout time.Duration `koanf:"evm-timeout"`

	// Parameters for the bloom indexer
	BloomBitsBlocks uint64 `koanf:"bloom-bits-blocks"`
	BloomConfirms   uint64 `koanf:"bloom-confirms"`

	// Parameters for the filter system
	FilterLogCacheSize int           `koanf:"filter-log-cache-size"`
	FilterTimeout      time.Duration `koanf:"filter-timeout"`

	// FeeHistoryMaxBlockCount limits the number of historical blocks a fee history request may cover
	FeeHistoryMaxBlockCount uint64 `koanf:"feehistory-max-block-count"`

	ArbDebug ArbDebugConfig `koanf:"arbdebug"`

	ClassicRedirect        string        `koanf:"classic-redirect"`
	ClassicRedirectTimeout time.Duration `koanf:"classic-redirect-timeout"`
}

type PublicNetAPI

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

PublicNetAPI offers network related RPC methods

func NewPublicNetAPI

func NewPublicNetAPI(networkVersion uint64) *PublicNetAPI

NewPublicNetAPI creates a new net API instance.

func (*PublicNetAPI) Version

func (s *PublicNetAPI) Version() string

Version returns the current ethereum protocol version.

type PublicTxPoolAPI

type PublicTxPoolAPI struct{}

PublicNetAPI offers network related RPC methods

func NewPublicTxPoolAPI

func NewPublicTxPoolAPI() *PublicTxPoolAPI

NewPublicNetAPI creates a new net API instance.

func (*PublicTxPoolAPI) Content

func (s *PublicTxPoolAPI) Content() map[string]map[string]map[string]*struct{}

Version returns the current ethereum protocol version.

type RecordingChainContext

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

func (*RecordingChainContext) Engine

func (*RecordingChainContext) GetHeader

func (r *RecordingChainContext) GetHeader(hash common.Hash, num uint64) *types.Header

func (*RecordingChainContext) GetMinBlockNumberAccessed

func (r *RecordingChainContext) GetMinBlockNumberAccessed() uint64

type RecordingDatabase

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

func NewRecordingDatabase

func NewRecordingDatabase(ethdb ethdb.Database, blockchain *core.BlockChain) *RecordingDatabase

func (*RecordingDatabase) Dereference

func (r *RecordingDatabase) Dereference(header *types.Header)

func (*RecordingDatabase) GetOrRecreateState

func (r *RecordingDatabase) GetOrRecreateState(ctx context.Context, header *types.Header, logFunc StateBuildingLogFunction) (*state.StateDB, error)

func (*RecordingDatabase) PreimagesFromRecording

func (r *RecordingDatabase) PreimagesFromRecording(chainContextIf core.ChainContext, recordingDb *RecordingKV) (map[common.Hash][]byte, error)

func (*RecordingDatabase) PrepareRecording

func (r *RecordingDatabase) PrepareRecording(ctx context.Context, lastBlockHeader *types.Header, logFunc StateBuildingLogFunction) (*state.StateDB, core.ChainContext, *RecordingKV, error)

func (*RecordingDatabase) ReferenceCount

func (r *RecordingDatabase) ReferenceCount() int64

func (*RecordingDatabase) StateFor

func (r *RecordingDatabase) StateFor(header *types.Header) (*state.StateDB, error)

Normal geth state.New + Reference is not atomic vs Dereference. This one is. This function does not recreate a state

func (*RecordingDatabase) WriteStateToDatabase

func (r *RecordingDatabase) WriteStateToDatabase(header *types.Header) error

type RecordingKV

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

func (*RecordingKV) Close

func (db *RecordingKV) Close() error

func (*RecordingKV) Compact

func (db *RecordingKV) Compact(start []byte, limit []byte) error

func (*RecordingKV) Delete

func (db *RecordingKV) Delete(key []byte) error

func (*RecordingKV) EnableBypass

func (db *RecordingKV) EnableBypass()

func (*RecordingKV) Get

func (db *RecordingKV) Get(key []byte) ([]byte, error)

func (*RecordingKV) GetRecordedEntries

func (db *RecordingKV) GetRecordedEntries() map[common.Hash][]byte

func (*RecordingKV) Has

func (db *RecordingKV) Has(key []byte) (bool, error)

func (*RecordingKV) NewBatch

func (db *RecordingKV) NewBatch() ethdb.Batch

func (*RecordingKV) NewBatchWithSize

func (db *RecordingKV) NewBatchWithSize(size int) ethdb.Batch

func (*RecordingKV) NewIterator

func (db *RecordingKV) NewIterator(prefix []byte, start []byte) ethdb.Iterator

func (*RecordingKV) NewSnapshot

func (db *RecordingKV) NewSnapshot() (ethdb.Snapshot, error)

func (*RecordingKV) Put

func (db *RecordingKV) Put(key []byte, value []byte) error

func (*RecordingKV) Release

func (db *RecordingKV) Release()

func (*RecordingKV) Stat

func (db *RecordingKV) Stat(property string) (string, error)

type StateBuildingLogFunction

type StateBuildingLogFunction func(targetHeader, header *types.Header, hasState bool)

type SyncProgressBackend

type SyncProgressBackend interface {
	SyncProgressMap() map[string]interface{}
	SafeBlockNumber(ctx context.Context) (uint64, error)
	FinalizedBlockNumber(ctx context.Context) (uint64, error)
}

type TransactionArgs

type TransactionArgs = ethapi.TransactionArgs

Jump to

Keyboard shortcuts

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