Versions in this module Expand all Collapse all v0 v0.11.7 Jun 29, 2023 Changes in this version + const GenesisTestAddr + const GenesisTestKey + var Codec codec.Manager + var EVMInputGas uint64 = (common.AddressLength+wrappers.LongLen+hashing.HashLen+wrappers.LongLen)*TxBytesGas + secp256k1fx.CostPerSignature + var EVMOutputGas uint64 = (common.AddressLength + wrappers.LongLen + hashing.HashLen) * TxBytesGas + var GitCommit string + var ID = ids.ID + var TxBytesGas uint64 = 1 + var Version string = "v0.11.5" + func CorethJSONFormat(alias string) log.Format + func CorethTermFormat(alias string) log.Format + func GetEthAddress(privKey *crypto.PrivateKeySECP256K1R) common.Address + func IsSortedAndUniqueEVMInputs(inputs []EVMInput) bool + func IsSortedAndUniqueEVMOutputs(outputs []EVMOutput) bool + func IsSortedEVMOutputs(outputs []EVMOutput) bool + func NewAtomicTxRepository(db *versiondb.Database, codec codec.Manager, lastAcceptedHeight uint64, ...) (*atomicTxRepository, error) + func ParseEthAddress(addrStr string) (common.Address, error) + func PublicKeyToEthAddress(pubKey *crypto.PublicKeySECP256K1R) common.Address + func SortEVMInputsAndSigners(inputs []EVMInput, signers [][]*crypto.PrivateKeySECP256K1R) + func SortEVMOutputs(outputs []EVMOutput) + type Admin struct + func NewAdminService(vm *VM, performanceDir string) *Admin + func (p *Admin) GetVMConfig(_ *http.Request, _ *struct{}, reply *ConfigReply) error + func (p *Admin) LockProfile(_ *http.Request, _ *struct{}, _ *api.EmptyReply) error + func (p *Admin) MemoryProfile(_ *http.Request, _ *struct{}, _ *api.EmptyReply) error + func (p *Admin) SetLogLevel(_ *http.Request, args *SetLogLevelArgs, reply *api.EmptyReply) error + func (p *Admin) StartCPUProfiler(_ *http.Request, _ *struct{}, _ *api.EmptyReply) error + func (p *Admin) StopCPUProfiler(r *http.Request, _ *struct{}, _ *api.EmptyReply) error + type AtomicBackend interface + ApplyToSharedMemory func(lastAcceptedBlock uint64) error + AtomicTrie func() AtomicTrie + GetVerifiedAtomicState func(blockHash common.Hash) (AtomicState, error) + InsertTxs func(blockHash common.Hash, blockHeight uint64, parentHash common.Hash, txs []*Tx) (common.Hash, error) + IsBonus func(blockHeight uint64, blockHash common.Hash) bool + MarkApplyToSharedMemoryCursor func(previousLastAcceptedHeight uint64) error + SetLastAccepted func(lastAcceptedHash common.Hash) + Syncer func(client syncclient.LeafClient, targetRoot common.Hash, targetHeight uint64) (Syncer, error) + func NewAtomicBackend(db *versiondb.Database, sharedMemory atomic.SharedMemory, ...) (AtomicBackend, error) + type AtomicState interface + Accept func(commitBatch database.Batch) error + Reject func() error + Root func() common.Hash + type AtomicTrie interface + AcceptTrie func(height uint64, root common.Hash) (bool, error) + InsertTrie func(nodes *trie.NodeSet, root common.Hash) error + Iterator func(hash common.Hash, cursor []byte) (AtomicTrieIterator, error) + LastAcceptedRoot func() common.Hash + LastCommitted func() (common.Hash, uint64) + OpenTrie func(hash common.Hash) (*trie.Trie, error) + RejectTrie func(root common.Hash) error + Root func(height uint64) (common.Hash, error) + TrieDB func() *trie.Database + UpdateTrie func(tr *trie.Trie, height uint64, atomicOps map[ids.ID]*atomic.Requests) error + type AtomicTrieIterator interface + AtomicOps func() *atomic.Requests + BlockNumber func() uint64 + BlockchainID func() ids.ID + Error func() error + Key func() []byte + Next func() bool + func NewAtomicTrieIterator(trieIterator *trie.Iterator, codec codec.Manager) AtomicTrieIterator + type AtomicTxRepository interface + Codec func() codec.Manager + GetByHeight func(height uint64) ([]*Tx, error) + GetByTxID func(txID ids.ID) (*Tx, uint64, error) + GetIndexHeight func() (uint64, error) + IterateByHeight func(start uint64) database.Iterator + Write func(height uint64, txs []*Tx) error + WriteBonus func(height uint64, txs []*Tx) error + type AvaxAPI struct + func (service *AvaxAPI) Export(_ *http.Request, args *ExportArgs, response *api.JSONTxID) error + func (service *AvaxAPI) ExportAVAX(_ *http.Request, args *ExportAVAXArgs, response *api.JSONTxID) error + func (service *AvaxAPI) ExportKey(r *http.Request, args *ExportKeyArgs, reply *ExportKeyReply) error + func (service *AvaxAPI) GetAtomicTx(r *http.Request, args *api.GetTxArgs, reply *FormattedTx) error + func (service *AvaxAPI) GetAtomicTxStatus(r *http.Request, args *api.JSONTxID, reply *GetAtomicTxStatusReply) error + func (service *AvaxAPI) GetUTXOs(r *http.Request, args *api.GetUTXOsArgs, reply *api.GetUTXOsReply) error + func (service *AvaxAPI) Import(_ *http.Request, args *ImportArgs, response *api.JSONTxID) error + func (service *AvaxAPI) ImportAVAX(_ *http.Request, args *ImportArgs, response *api.JSONTxID) error + func (service *AvaxAPI) ImportKey(r *http.Request, args *ImportKeyArgs, reply *api.JSONAddress) error + func (service *AvaxAPI) IssueTx(r *http.Request, args *api.FormattedTx, response *api.JSONTxID) error + func (service *AvaxAPI) Version(r *http.Request, args *struct{}, reply *VersionReply) error + type Batch struct + func (batch Batch) Replay(w ethdb.KeyValueWriter) error + func (batch Batch) ValueSize() int + type Block struct + func (b *Block) Accept(context.Context) error + func (b *Block) Bytes() []byte + func (b *Block) Height() uint64 + func (b *Block) ID() ids.ID + func (b *Block) Parent() ids.ID + func (b *Block) Reject(context.Context) error + func (b *Block) SetStatus(status choices.Status) + func (b *Block) Status() choices.Status + func (b *Block) String() string + func (b *Block) Timestamp() time.Time + func (b *Block) Verify(context.Context) error + type BlockValidator interface + SyntacticVerify func(b *Block, rules params.Rules) error + func NewBlockValidator(extDataHashes map[common.Hash]common.Hash) BlockValidator + type BuildGenesisReply struct + Bytes string + Encoding formatting.Encoding + type Client interface + Export func(ctx context.Context, userPass api.UserPass, amount uint64, to string, ...) (ids.ID, error) + ExportAVAX func(ctx context.Context, userPass api.UserPass, amount uint64, to string) (ids.ID, error) + ExportKey func(ctx context.Context, userPass api.UserPass, addr string) (*crypto.PrivateKeySECP256K1R, string, error) + GetAtomicTx func(ctx context.Context, txID ids.ID) ([]byte, error) + GetAtomicTxStatus func(ctx context.Context, txID ids.ID) (Status, error) + GetAtomicUTXOs func(ctx context.Context, addrs []string, sourceChain string, limit uint32, ...) ([][]byte, api.Index, error) + GetVMConfig func(ctx context.Context) (*Config, error) + Import func(ctx context.Context, userPass api.UserPass, to string, sourceChain string) (ids.ID, error) + ImportKey func(ctx context.Context, userPass api.UserPass, ...) (string, error) + IssueTx func(ctx context.Context, txBytes []byte) (ids.ID, error) + ListAddresses func(ctx context.Context, userPass api.UserPass) ([]string, error) + LockProfile func(ctx context.Context) error + MemoryProfile func(ctx context.Context) error + SetLogLevel func(ctx context.Context, level log.Lvl) error + StartCPUProfiler func(ctx context.Context) error + StopCPUProfiler func(ctx context.Context) error + func NewCChainClient(uri string) Client + func NewClient(uri, chain string) Client + type Config struct + APIMaxDuration Duration + AcceptedCacheSize int + AcceptorQueueLimit int + AllowMissingTries bool + AllowUnfinalizedQueries bool + AllowUnprotectedTxHashes []common.Hash + AllowUnprotectedTxs bool + CommitInterval uint64 + ContinuousProfilerDir string + ContinuousProfilerFrequency Duration + ContinuousProfilerMaxFiles int + CorethAdminAPIDir string + CorethAdminAPIEnabled bool + EnabledEthAPIs []string + InspectDatabase bool + KeystoreDirectory string + KeystoreExternalSigner string + KeystoreInsecureUnlockAllowed bool + LocalTxsEnabled bool + LogJSONFormat bool + LogLevel string + MaxBlocksPerRequest int64 + MaxOutboundActiveCrossChainRequests int64 + MaxOutboundActiveRequests int64 + MetricsExpensiveEnabled bool + OfflinePruning bool + OfflinePruningBloomFilterSize uint64 + OfflinePruningDataDirectory string + PopulateMissingTries *uint64 + PopulateMissingTriesParallelism int + Preimages bool + Pruning bool + RPCGasCap uint64 + RPCTxFeeCap float64 + RemoteTxGossipOnlyEnabled bool + SkipUpgradeCheck bool + SnapshotAsync bool + SnapshotCache int + SnapshotVerify bool + SnowmanAPIEnabled bool + StateSyncCommitInterval uint64 + StateSyncEnabled bool + StateSyncIDs string + StateSyncMinBlocks uint64 + StateSyncServerTrieCache int + StateSyncSkipResume bool + TrieCleanCache int + TrieCleanJournal string + TrieCleanRejournal Duration + TrieDirtyCache int + TrieDirtyCommitTarget int + TxLookupLimit uint64 + TxPoolAccountQueue uint64 + TxPoolAccountSlots uint64 + TxPoolGlobalQueue uint64 + TxPoolGlobalSlots uint64 + TxPoolJournal string + TxPoolPriceBump uint64 + TxPoolPriceLimit uint64 + TxPoolRejournal Duration + TxRegossipFrequency Duration + TxRegossipMaxSize int + WSCPUMaxStored Duration + WSCPURefillRate Duration + func (c *Config) SetDefaults() + func (c *Config) Validate() error + func (c Config) EthAPIs() []string + func (c Config) EthBackendSettings() eth.Settings + type ConfigReply struct + Config *Config + type CorethLogger struct + func InitLogger(alias string, level string, jsonFormat bool, writer io.Writer) (CorethLogger, error) + func (c *CorethLogger) SetLogLevel(level string) error + type Database struct + func (db Database) NewBatch() ethdb.Batch + func (db Database) NewBatchWithSize(size int) ethdb.Batch + func (db Database) NewIterator(prefix []byte, start []byte) ethdb.Iterator + func (db Database) NewIteratorWithStart(start []byte) ethdb.Iterator + func (db Database) Stat(string) (string, error) + type Duration struct + func (d *Duration) UnmarshalJSON(data []byte) (err error) + func (d Duration) MarshalJSON() ([]byte, error) + func (d Duration) String() string + type EVMInput struct + Address common.Address + Amount uint64 + AssetID ids.ID + Nonce uint64 + func (in *EVMInput) Verify() error + type EVMOutput struct + Address common.Address + Amount uint64 + AssetID ids.ID + func (out *EVMOutput) Verify() error + type ExportAVAXArgs struct + Amount json.Uint64 + BaseFee *hexutil.Big + To string + type ExportArgs struct + AssetID string + type ExportKeyArgs struct + Address string + type ExportKeyReply struct + PrivateKey *crypto.PrivateKeySECP256K1R + PrivateKeyHex string + type Factory struct + func (f *Factory) New(*snow.Context) (interface{}, error) + type FormattedTx struct + BlockHeight *json.Uint64 + type GetAcceptedFrontReply struct + Hash common.Hash + Number *big.Int + type GetAtomicTxStatusReply struct + BlockHeight *json.Uint64 + Status Status + type GossipHandler struct + func NewGossipHandler(vm *VM, stats GossipReceivedStats) *GossipHandler + func (h *GossipHandler) HandleAtomicTx(nodeID ids.NodeID, msg message.AtomicTxGossip) error + func (h *GossipHandler) HandleEthTxs(nodeID ids.NodeID, msg message.EthTxsGossip) error + type GossipReceivedStats interface + IncAtomicGossipReceived func() + IncAtomicGossipReceivedDropped func() + IncAtomicGossipReceivedError func() + IncAtomicGossipReceivedKnown func() + IncAtomicGossipReceivedNew func() + IncEthTxsGossipReceived func() + IncEthTxsGossipReceivedKnown func() + IncEthTxsGossipReceivedNew func() + type GossipSentStats interface + IncAtomicGossipSent func() + IncEthTxsGossipSent func() + IncEthTxsRegossipQueued func() + IncEthTxsRegossipQueuedLocal func(count int) + IncEthTxsRegossipQueuedRemote func(count int) + type GossipStats interface + func NewGossipStats() GossipStats + type Gossiper interface + GossipAtomicTxs func(txs []*Tx) error + GossipEthTxs func(txs []*types.Transaction) error + type ImportArgs struct + BaseFee *hexutil.Big + SourceChain string + To string + type ImportKeyArgs struct + PrivateKey *crypto.PrivateKeySECP256K1R + type Mempool struct + AVAXAssetID ids.ID + Pending chan struct{} + func NewMempool(AVAXAssetID ids.ID, maxSize int) *Mempool + func (m *Mempool) AddTx(tx *Tx) error + func (m *Mempool) CancelCurrentTx(txID ids.ID) + func (m *Mempool) CancelCurrentTxs() + func (m *Mempool) DiscardCurrentTx(txID ids.ID) + func (m *Mempool) DiscardCurrentTxs() + func (m *Mempool) ForceAddTx(tx *Tx) error + func (m *Mempool) GetNewTxs() []*Tx + func (m *Mempool) GetPendingTx(txID ids.ID) (*Tx, bool) + func (m *Mempool) GetTx(txID ids.ID) (*Tx, bool, bool) + func (m *Mempool) IssueCurrentTxs() + func (m *Mempool) Len() int + func (m *Mempool) NextTx() (*Tx, bool) + func (m *Mempool) RemoveTx(tx *Tx) + type SetLogLevelArgs struct + Level string + type SnowmanAPI struct + func (api *SnowmanAPI) GetAcceptedFront(ctx context.Context) (*GetAcceptedFrontReply, error) + func (api *SnowmanAPI) IssueBlock(ctx context.Context) error + type StateSyncClient interface + Error func() error + GetOngoingSyncStateSummary func(context.Context) (block.StateSummary, error) + ParseStateSummary func(ctx context.Context, summaryBytes []byte) (block.StateSummary, error) + Shutdown func() error + StateSyncClearOngoingSummary func() error + StateSyncEnabled func(context.Context) (bool, error) + func NewStateSyncClient(config *stateSyncClientConfig) StateSyncClient + type StateSyncServer interface + GetLastStateSummary func(context.Context) (block.StateSummary, error) + GetStateSummary func(context.Context, uint64) (block.StateSummary, error) + func NewStateSyncServer(config *stateSyncServerConfig) StateSyncServer + type StaticService struct + func (*StaticService) BuildGenesis(_ context.Context, args *core.Genesis) (*BuildGenesisReply, error) + type Status uint32 + const Accepted + const Dropped + const Processing + const Unknown + func (s *Status) UnmarshalJSON(b []byte) error + func (s Status) MarshalJSON() ([]byte, error) + func (s Status) String() string + func (s Status) Valid() error + type Syncer interface + Done func() <-chan error + Start func(ctx context.Context) error + type TestUnsignedTx struct + AcceptRequestsBlockchainIDV ids.ID + AcceptRequestsV *atomic.Requests + BurnedV uint64 + EVMStateTransferV error + GasUsedV uint64 + IDV ids.ID + InputUTXOsV set.Set[ids.ID] + SemanticVerifyV error + SignedBytesV []byte + UnsignedBytesV []byte + VerifyV error + func (t *TestUnsignedTx) AtomicOps() (ids.ID, *atomic.Requests, error) + func (t *TestUnsignedTx) Burned(assetID ids.ID) (uint64, error) + func (t *TestUnsignedTx) Bytes() []byte + func (t *TestUnsignedTx) EVMStateTransfer(ctx *snow.Context, state *state.StateDB) error + func (t *TestUnsignedTx) GasUsed(fixedFee bool) (uint64, error) + func (t *TestUnsignedTx) ID() ids.ID + func (t *TestUnsignedTx) Initialize(unsignedBytes, signedBytes []byte) + func (t *TestUnsignedTx) InputUTXOs() set.Set[ids.ID] + func (t *TestUnsignedTx) SemanticVerify(vm *VM, stx *Tx, parent *Block, baseFee *big.Int, rules params.Rules) error + func (t *TestUnsignedTx) SignedBytes() []byte + func (t *TestUnsignedTx) Verify(ctx *snow.Context, rules params.Rules) error + type Tx struct + Creds []verify.Verifiable + func ExtractAtomicTx(atomicTxBytes []byte, codec codec.Manager) (*Tx, error) + func ExtractAtomicTxs(atomicTxBytes []byte, batch bool, codec codec.Manager) ([]*Tx, error) + func ExtractAtomicTxsBatch(atomicTxBytes []byte, codec codec.Manager) ([]*Tx, error) + func (tx *Tx) BlockFeeContribution(fixedFee bool, avaxAssetID ids.ID, baseFee *big.Int) (*big.Int, *big.Int, error) + func (tx *Tx) Sign(c codec.Manager, signers [][]*crypto.PrivateKeySECP256K1R) error + type UnsignedAtomicTx interface + AtomicOps func() (ids.ID, *atomic.Requests, error) + EVMStateTransfer func(ctx *snow.Context, state *state.StateDB) error + InputUTXOs func() set.Set[ids.ID] + SemanticVerify func(vm *VM, stx *Tx, parent *Block, baseFee *big.Int, rules params.Rules) error + Verify func(ctx *snow.Context, rules params.Rules) error + type UnsignedExportTx struct + BlockchainID ids.ID + DestinationChain ids.ID + ExportedOutputs []*avax.TransferableOutput + Ins []EVMInput + NetworkID uint32 + func (utx *UnsignedExportTx) AtomicOps() (ids.ID, *atomic.Requests, error) + func (utx *UnsignedExportTx) Burned(assetID ids.ID) (uint64, error) + func (utx *UnsignedExportTx) EVMStateTransfer(ctx *snow.Context, state *state.StateDB) error + func (utx *UnsignedExportTx) GasUsed(fixedFee bool) (uint64, error) + func (utx *UnsignedExportTx) InputUTXOs() set.Set[ids.ID] + func (utx *UnsignedExportTx) SemanticVerify(vm *VM, stx *Tx, _ *Block, baseFee *big.Int, rules params.Rules) error + func (utx *UnsignedExportTx) Verify(ctx *snow.Context, rules params.Rules) error + type UnsignedImportTx struct + BlockchainID ids.ID + ImportedInputs []*avax.TransferableInput + NetworkID uint32 + Outs []EVMOutput + SourceChain ids.ID + func (utx *UnsignedImportTx) AtomicOps() (ids.ID, *atomic.Requests, error) + func (utx *UnsignedImportTx) Burned(assetID ids.ID) (uint64, error) + func (utx *UnsignedImportTx) EVMStateTransfer(ctx *snow.Context, state *state.StateDB) error + func (utx *UnsignedImportTx) GasUsed(fixedFee bool) (uint64, error) + func (utx *UnsignedImportTx) InputUTXOs() set.Set[ids.ID] + func (utx *UnsignedImportTx) SemanticVerify(vm *VM, stx *Tx, parent *Block, baseFee *big.Int, rules params.Rules) error + func (utx *UnsignedImportTx) Verify(ctx *snow.Context, rules params.Rules) error + type UnsignedTx interface + Burned func(assetID ids.ID) (uint64, error) + Bytes func() []byte + GasUsed func(fixedFee bool) (uint64, error) + ID func() ids.ID + Initialize func(unsignedBytes, signedBytes []byte) + SignedBytes func() []byte + type VM struct + IsPlugin bool + func (vm *VM) Clock() *mockable.Clock + func (vm *VM) Codec() codec.Manager + func (vm *VM) CodecRegistry() codec.Registry + func (vm *VM) CreateHandlers(context.Context) (map[string]*commonEng.HTTPHandler, error) + func (vm *VM) CreateStaticHandlers(context.Context) (map[string]*commonEng.HTTPHandler, error) + func (vm *VM) FormatAddress(chainID ids.ID, addr ids.ShortID) (string, error) + func (vm *VM) FormatLocalAddress(addr ids.ShortID) (string, error) + func (vm *VM) GetActivationTime() time.Time + func (vm *VM) GetAtomicUTXOs(chainID ids.ID, addrs set.Set[ids.ShortID], startAddr ids.ShortID, ...) ([]*avax.UTXO, ids.ShortID, ids.ID, error) + func (vm *VM) GetBlockIDAtHeight(_ context.Context, blkHeight uint64) (ids.ID, error) + func (vm *VM) GetCurrentNonce(address common.Address) (uint64, error) + func (vm *VM) GetSpendableAVAXWithFee(keys []*crypto.PrivateKeySECP256K1R, amount uint64, cost uint64, ...) ([]EVMInput, [][]*crypto.PrivateKeySECP256K1R, error) + func (vm *VM) GetSpendableFunds(keys []*crypto.PrivateKeySECP256K1R, assetID ids.ID, amount uint64) ([]EVMInput, [][]*crypto.PrivateKeySECP256K1R, error) + func (vm *VM) HealthCheck(context.Context) (interface{}, error) + func (vm *VM) Initialize(_ context.Context, chainCtx *snow.Context, dbManager manager.Manager, ...) error + func (vm *VM) Logger() logging.Logger + func (vm *VM) NewBlockBuilder(notifyBuildBlockChan chan<- commonEng.Message) *blockBuilder + func (vm *VM) ParseAddress(addrStr string) (ids.ID, ids.ShortID, error) + func (vm *VM) ParseEthBlock(b []byte) (*types.Block, error) + func (vm *VM) ParseLocalAddress(addrStr string) (ids.ShortID, error) + func (vm *VM) SetPreference(ctx context.Context, blkID ids.ID) error + func (vm *VM) SetState(_ context.Context, state snow.State) error + func (vm *VM) Shutdown(context.Context) error + func (vm *VM) VerifyHeightIndex(context.Context) error + func (vm *VM) Version(context.Context) (string, error) + type VersionReply struct + Version string v0.11.7-rc.0 Jun 29, 2023