precheck

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrecheckError       = "verify tx err"
	ErrTxSign           = "tx signature verify failed"
	ErrTo               = "tx from and to address is same"
	ErrTxEventType      = "invalid tx event type"
	ErrParseTxEventType = "parse tx event type error"
	ErrGasPriceTooLow   = "gas price too low"
)

Variables

View Source
var (

	// ErrOversizedData is returned if the input data of a transaction is greater
	// than some meaningful limit a user might use. This is not a consensus error
	// making the transaction invalid, rather a DOS protection.
	ErrOversizedData = errors.New("oversized data")
)

Functions

This section is empty.

Types

type PreCheck

type PreCheck interface {
	// Start starts the precheck service
	Start()

	// PostUncheckedTxEvent posts unchecked tx event to precheckMgr
	PostUncheckedTxEvent(ev *common.UncheckedTxEvent)

	// CommitValidTxs returns a channel of valid transactions
	CommitValidTxs() chan *ValidTxs

	UpdateEpochInfo(epoch *rbft.EpochInfo)
}

type TxPreCheckMgr

type TxPreCheckMgr struct {
	BaseFee *big.Int // current is 0
	// contains filtered or unexported fields
}

func NewTxPreCheckMgr

func NewTxPreCheckMgr(ctx context.Context, conf *common.Config) *TxPreCheckMgr

func (*TxPreCheckMgr) CommitValidTxs

func (tp *TxPreCheckMgr) CommitValidTxs() chan *ValidTxs

func (*TxPreCheckMgr) PostUncheckedTxEvent

func (tp *TxPreCheckMgr) PostUncheckedTxEvent(ev *common.UncheckedTxEvent)

func (*TxPreCheckMgr) Start

func (tp *TxPreCheckMgr) Start()

func (*TxPreCheckMgr) UpdateEpochInfo

func (tp *TxPreCheckMgr) UpdateEpochInfo(epoch *rbft.EpochInfo)

type ValidTxs

type ValidTxs struct {
	Local            bool
	Txs              []*types.Transaction
	LocalCheckRespCh chan *common.TxResp
	LocalPoolRespCh  chan *common.TxResp
}

Directories

Path Synopsis
Package mock_precheck is a generated GoMock package.
Package mock_precheck is a generated GoMock package.

Jump to

Keyboard shortcuts

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