burrow: github.com/hyperledger/burrow/execution Index | Files | Directories

package execution

import "github.com/hyperledger/burrow/execution"


Package Files

accounts.go config.go execution.go simulated_call.go transactor.go version.go


const (
    SubscribeBufferSize = 10
const VersionOffset = int64(1)

Since we have an initial save of our state forest we start one version ahead of the block height, but from then on we should track height by this offset.

func CallCodeSim Uses

func CallCodeSim(reader acmstate.Reader, blockchain bcm.BlockchainInfo, fromAddress, address crypto.Address, code, data []byte,
    logger *logging.Logger) (*exec.TxExecution, error)

Run the given code on an isolated and unpersisted state Cannot be used to create new contracts.

func CallSim Uses

func CallSim(reader acmstate.Reader, blockchain bcm.BlockchainInfo, fromAddress, address crypto.Address, data []byte,
    logger *logging.Logger) (*exec.TxExecution, error)

Run a contract's code on an isolated and unpersisted state Cannot be used to create new contracts

func HeightAtVersion Uses

func HeightAtVersion(version int64) uint64

func VMOptions Uses

func VMOptions(vmOptions evm.Options) func(*executor)

func VersionAtHeight Uses

func VersionAtHeight(height uint64) int64

type Accounts Uses

type Accounts struct {
    // contains filtered or unexported fields

Accounts pairs an underlying state.Reader with a KeyClient to provide a signing variant of an account it also maintains a lock over addresses to provide a linearisation of signing events using SequentialSigningAccount

func NewAccounts Uses

func NewAccounts(reader acmstate.Reader, keyClient keys.KeyClient, mutexCount int) *Accounts

func (*Accounts) SequentialSigningAccount Uses

func (accs *Accounts) SequentialSigningAccount(address crypto.Address) (*SequentialSigningAccount, error)

func (*Accounts) SigningAccount Uses

func (accs *Accounts) SigningAccount(address crypto.Address) (*SigningAccount, error)

type BatchCommitter Uses

type BatchCommitter interface {
    // Commit execution results to underlying State and provide opportunity to mutate state before it is saved
    Commit(header *abciTypes.Header) (stateHash []byte, err error)

Executes transactions

func NewBatchCommitter Uses

func NewBatchCommitter(backend ExecutorState, params Params, blockchain engine.Blockchain, emitter *event.Emitter,
    logger *logging.Logger, options ...Option) (BatchCommitter, error)

type BatchExecutor Uses

type BatchExecutor interface {
    // Provides access to write lock for a BatchExecutor so reads can be prevented for the duration of a commit
    // Used by execution.Accounts to implement memory pool signing
    // Execute transaction against block cache (i.e. block buffer)
    // Reset executor to underlying State
    Reset() error

func NewBatchChecker Uses

func NewBatchChecker(backend ExecutorState, params Params, blockchain engine.Blockchain, logger *logging.Logger,
    options ...Option) (BatchExecutor, error)

Wraps a cache of what is variously known as the 'check cache' and 'mempool'

type ExecutionConfig Uses

type ExecutionConfig struct {
    // This parameter scales the default Tendermint timeouts. A value of 1 gives the Tendermint defaults designed to
    // work for 100 node + public network. Smaller networks should be able to sustain lower values.
    // When running in no-consensus mode (Tendermint.Enabled = false) this scales the block duration with 1.0 meaning 1 second
    // and 0 meaning commit immediately
    TimeoutFactor            float64
    CallStackMaxDepth        uint64
    DataStackInitialCapacity uint64
    DataStackMaxDepth        uint64
    VMOptions                []VMOption `json:",omitempty" toml:",omitempty"`

func DefaultExecutionConfig Uses

func DefaultExecutionConfig() *ExecutionConfig

func (*ExecutionConfig) ExecutionOptions Uses

func (ec *ExecutionConfig) ExecutionOptions() ([]Option, error)

type Executor Uses

type Executor interface {
    Execute(txEnv *txs.Envelope) (*exec.TxExecution, error)

type ExecutorFunc Uses

type ExecutorFunc func(txEnv *txs.Envelope) (*exec.TxExecution, error)

func (ExecutorFunc) Execute Uses

func (f ExecutorFunc) Execute(txEnv *txs.Envelope) (*exec.TxExecution, error)

type ExecutorState Uses

type ExecutorState interface {
    Update(updater func(ws state.Updatable) error) (hash []byte, version int64, err error)
    LastStoredHeight() (uint64, error)

type Option Uses

type Option func(*executor)

type Params Uses

type Params struct {
    ChainID           string
    ProposalThreshold uint64

func ParamsFromGenesis Uses

func ParamsFromGenesis(genesisDoc *genesis.GenesisDoc) Params

type SequentialSigningAccount Uses

type SequentialSigningAccount struct {
    Address crypto.Address
    // contains filtered or unexported fields

func (*SequentialSigningAccount) Lock Uses

func (ssa *SequentialSigningAccount) Lock() (*SigningAccount, UnlockFunc, error)

type SigningAccount Uses

type SigningAccount struct {

type Transactor Uses

type Transactor struct {
    BlockchainInfo  bcm.BlockchainInfo
    Emitter         *event.Emitter
    MempoolAccounts *Accounts
    // contains filtered or unexported fields

Transactor is responsible for helping to formulate, sign, and broadcast transactions to tendermint

The BroadcastTx* methods are able to work against the mempool Accounts (pending) state rather than the committed (final) Accounts state and can assign a sequence number based on all of the txs seen since the last block - provided these transactions are successfully committed (via DeliverTx) then subsequent transactions will have valid sequence numbers. This allows Burrow to coordinate sequencing and signing for a key it holds or is provided - it is down to the key-holder to manage the mutual information between transactions concurrent within a new block window.

func NewTransactor Uses

func NewTransactor(tip bcm.BlockchainInfo, emitter *event.Emitter, mempoolAccounts *Accounts,
    checkTxAsync txChecker, id p2p.ID, txEncoder txs.Encoder, logger *logging.Logger) *Transactor

func (*Transactor) BroadcastTxAsync Uses

func (trans *Transactor) BroadcastTxAsync(ctx context.Context, txEnv *txs.Envelope) (*txs.Receipt, error)

Broadcast a transaction without waiting for confirmation - will attempt to sign server-side and set sequence numbers if no signatures are provided

func (*Transactor) BroadcastTxSync Uses

func (trans *Transactor) BroadcastTxSync(ctx context.Context, txEnv *txs.Envelope) (*exec.TxExecution, error)

func (*Transactor) CheckTxAsync Uses

func (trans *Transactor) CheckTxAsync(txEnv *txs.Envelope, callback func(res *abciTypes.Response)) error

func (*Transactor) CheckTxAsyncRaw Uses

func (trans *Transactor) CheckTxAsyncRaw(txBytes []byte, callback func(res *abciTypes.Response)) error

func (*Transactor) CheckTxSync Uses

func (trans *Transactor) CheckTxSync(ctx context.Context, txEnv *txs.Envelope) (*txs.Receipt, error)

Broadcast a transaction and waits for a response from the mempool. Transactions to BroadcastTx will block during various mempool operations (managed by Tendermint) including mempool Reap, Commit, and recheckTx.

func (*Transactor) CheckTxSyncRaw Uses

func (trans *Transactor) CheckTxSyncRaw(ctx context.Context, txBytes []byte) (*txs.Receipt, error)

func (*Transactor) MaybeSignTxMempool Uses

func (trans *Transactor) MaybeSignTxMempool(txEnv *txs.Envelope) (UnlockFunc, error)

func (*Transactor) SignTx Uses

func (trans *Transactor) SignTx(txEnv *txs.Envelope) (*txs.Envelope, error)

func (*Transactor) SignTxMempool Uses

func (trans *Transactor) SignTxMempool(txEnv *txs.Envelope) (*txs.Envelope, UnlockFunc, error)

type UnlockFunc Uses

type UnlockFunc func()

type VMOption Uses

type VMOption string
const (
    DebugOpcodes VMOption = "DebugOpcodes"
    DumpTokens   VMOption = "DumpTokens"



Package execution imports 34 packages (graph) and is imported by 32 packages. Updated 2020-08-04. Refresh now. Tools for package owners.