Documentation
¶
Index ¶
- Constants
- Variables
- func AddSystemAccBalance(ctx *types.Context, amount *uint256.Int) error
- func GetBalanceAfterBchTransfer(ctx *types.Context, address common.Address, value [32]byte) *uint256.Int
- func GetBlackHoleBalance(ctx *types.Context) *uint256.Int
- func GetSystemBalance(ctx *types.Context) *uint256.Int
- func LogsBloom(logs []types.Log) [256]byte
- func NewEbpTxExec(exeRoundCount, runnerNumber, parallelNum, defaultTxListCap int, ...) *txEngine
- func NewFrontierWithCtxAA(ctxAA []*ctxAndAccounts, addr2idx map[common.Address]int) *frontier
- func RegisterPredefinedContract(ctx *types.Context, address common.Address, ...)
- func ReloadQueryExecutorFn(aotDir string)
- func RunTxForRpc(currBlock *types.BlockInfo, estimateGas bool, runner *TxRunner) int64
- func StatusIsFailure(status int) bool
- func StatusToStr(status int) string
- func SubSenderAccBalance(ctx *types.Context, sender common.Address, amount *uint256.Int) error
- func SubSystemAccBalance(ctx *types.Context, amount *uint256.Int) error
- func TransferFromSenderAccToBlackHoleAcc(ctx *types.Context, sender common.Address, amount *uint256.Int) error
- type Frontier
- type TxExecutor
- type TxRange
- type TxRunner
- type VrfVerifyContract
Constants ¶
View Source
const ( DefaultTxGasLimit uint64 = 1000_0000 MaxGasPrice uint64 = 1e19 // 10BCH )
View Source
const ( RpcRunnersIdStart int = 10000 RpcRunnersCount int = 256 SMALL_BUF_SIZE int = int(C.SMALL_BUF_SIZE) )
View Source
const (
EnableRWList = false
)
View Source
const (
VRF_VERIFY_GAS uint64 = 5000
)
Variables ¶
View Source
var ( Sep206Address = common.HexToAddress("0x0000000000000000000000000000000000002711") BlockedAddress = common.HexToAddress("0x8c4F85ec71C966e45A6F4291f5271f8114a7Ba15") )
View Source
var AdjustGasUsed = true // It's a global variable because in tests we must change it to false to be compatible
View Source
var PredefinedContractManager map[common.Address]types.SystemContractExecutor
View Source
var (
QueryExecutorFn C.bridge_query_executor_fn
)
View Source
var RpcRunnerLocks [RpcRunnersCount]spinLock
View Source
var RpcRunners [RpcRunnersCount]*TxRunner
Its usage is similar with Runners. Runners are for transactions in block. RpcRunners are for transactions in Web3 RPC: call and estimateGas.
View Source
var Runners []*TxRunner
This is a global variable. The parameter 'collector_handler' passed to zero_depth_call_wrap is an index to select one TxRunner from this global variable.
Functions ¶
func AddSystemAccBalance ¶ added in v0.1.1
func GetBalanceAfterBchTransfer ¶ added in v0.4.0
func GetBlackHoleBalance ¶ added in v0.1.1
func NewEbpTxExec ¶
func NewFrontierWithCtxAA ¶ added in v0.4.0
func RegisterPredefinedContract ¶ added in v0.3.1
func ReloadQueryExecutorFn ¶ added in v0.4.3
func ReloadQueryExecutorFn(aotDir string)
func RunTxForRpc ¶
func StatusIsFailure ¶
func StatusToStr ¶
func SubSenderAccBalance ¶ added in v0.1.1
guarantee account exists externally
func SubSystemAccBalance ¶ added in v0.1.1
Types ¶
type Frontier ¶ added in v0.4.0
type Frontier interface {
GetLatestNonce(addr common.Address) (nonce uint64, exist bool)
SetLatestNonce(addr common.Address, newNonce uint64)
GetLatestBalance(addr common.Address) (balance *uint256.Int, exist bool)
SetLatestBalance(addr common.Address, balance *uint256.Int)
GetLatestTotalGas(addr common.Address) (gas uint64, exist bool)
SetLatestTotalGas(addr common.Address, gas uint64)
}
func GetEmptyFrontier ¶ added in v0.4.0
func GetEmptyFrontier() Frontier
type TxExecutor ¶
type TxExecutor interface {
SetAotParam(aotDir string, aotReloadInterval int64)
SetCheckRWInLoading(b bool)
//step 1: for deliverTx, collect block txs in engine.txList
CollectTx(tx *gethtypes.Transaction)
//step 2: for commit, check sig, insert regular txs standbyTxQ
Prepare(reorderSeed int64, minGasPrice, maxTxGasLimit uint64) Frontier
//step 3: for postCommit, parallel execute tx in standbyTxQ
Execute(currBlock *types.BlockInfo)
//set context
SetContext(ctx *types.Context)
Context() *types.Context
//collect infos, not thread safe
CollectedTxsCount() int
CommittedTxs() []*types.Transaction
CommittedTxIds() [][32]byte
CommittedTxsForMoDB() []modbtypes.Tx
GasUsedInfo() (gasUsed uint64, feeRefund, gasFee uint256.Int)
StandbyQLen() int
}
type TxRunner ¶
type TxRunner struct {
Ctx *types.Context
GasUsed uint64
FeeRefund uint256.Int
Tx *types.TxToRun
Logs []types.EvmLog
Status int
OutData []byte
ForRpc bool
CreatedContractAddress common.Address
InternalTxCalls []types.InternalTxCall
InternalTxReturns []types.InternalTxReturn
RwLists *types.ReadWriteLists
}
type VrfVerifyContract ¶ added in v0.4.0
type VrfVerifyContract struct{}
func (*VrfVerifyContract) RequiredGas ¶ added in v0.4.0
func (vdfc *VrfVerifyContract) RequiredGas(input []byte) uint64
Click to show internal directories.
Click to hide internal directories.