Documentation
¶
Index ¶
- Constants
- func NewProcessBackwardsTask(payload *ProcessPayload) (*asynq.Task, error)
- func NewProcessForwardsTask(payload *ProcessPayload) (*asynq.Task, error)
- func NewVerifyBackwardsTask(payload *VerifyPayload) (*asynq.Task, error)
- func NewVerifyForwardsTask(payload *VerifyPayload) (*asynq.Task, error)
- type Config
- type CountMismatchError
- type Dependencies
- type ProcessPayload
- type Processor
- func (p *Processor) EnqueueTask(ctx context.Context, task *asynq.Task, opts ...asynq.Option) error
- func (p *Processor) GetHandlers() map[string]asynq.HandlerFunc
- func (p *Processor) GetQueues() []c.QueueInfo
- func (p *Processor) Name() string
- func (p *Processor) ProcessNextBlock(ctx context.Context) error
- func (p *Processor) SetProcessingMode(mode string)
- func (p *Processor) Start(ctx context.Context) error
- func (p *Processor) Stop(ctx context.Context) error
- type Transaction
- type VerifyPayload
Constants ¶
const ( // ProcessForwardsTaskType is the task type for forwards processing. ProcessForwardsTaskType = "transaction_simple_process_forwards" // ProcessBackwardsTaskType is the task type for backwards processing. ProcessBackwardsTaskType = "transaction_simple_process_backwards" // VerifyForwardsTaskType is the task type for forwards verification. VerifyForwardsTaskType = "transaction_simple_verify_forwards" // VerifyBackwardsTaskType is the task type for backwards verification. VerifyBackwardsTaskType = "transaction_simple_verify_backwards" )
const ProcessorName = "transaction_simple"
ProcessorName is the name of the simple transaction processor.
Variables ¶
This section is empty.
Functions ¶
func NewProcessBackwardsTask ¶
func NewProcessBackwardsTask(payload *ProcessPayload) (*asynq.Task, error)
NewProcessBackwardsTask creates a new backwards process task.
func NewProcessForwardsTask ¶
func NewProcessForwardsTask(payload *ProcessPayload) (*asynq.Task, error)
NewProcessForwardsTask creates a new forwards process task.
func NewVerifyBackwardsTask ¶
func NewVerifyBackwardsTask(payload *VerifyPayload) (*asynq.Task, error)
NewVerifyBackwardsTask creates a new backwards verify task.
func NewVerifyForwardsTask ¶
func NewVerifyForwardsTask(payload *VerifyPayload) (*asynq.Task, error)
NewVerifyForwardsTask creates a new forwards verify task.
Types ¶
type Config ¶
type Config struct {
clickhouse.Config `yaml:",inline"`
Enabled bool `yaml:"enabled"`
Table string `yaml:"table"`
}
Config holds configuration for the simple transaction processor.
type CountMismatchError ¶
CountMismatchError represents a transaction count mismatch.
func (*CountMismatchError) Error ¶
func (e *CountMismatchError) Error() string
Error implements the error interface.
type Dependencies ¶
type Dependencies struct {
Log logrus.FieldLogger
Pool *ethereum.Pool
Network *ethereum.Network
State *state.Manager
AsynqClient *asynq.Client
RedisPrefix string
}
Dependencies contains the dependencies needed for the processor.
type ProcessPayload ¶
type ProcessPayload struct {
BlockNumber big.Int `json:"block_number"`
NetworkID int32 `json:"network_id"`
NetworkName string `json:"network_name"`
ProcessingMode string `json:"processing_mode"`
}
ProcessPayload represents the payload for processing a block.
func (*ProcessPayload) MarshalBinary ¶
func (p *ProcessPayload) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler.
func (*ProcessPayload) UnmarshalBinary ¶
func (p *ProcessPayload) UnmarshalBinary(data []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler.
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Processor handles simple transaction processing.
func (*Processor) EnqueueTask ¶
EnqueueTask enqueues a task to the specified queue.
func (*Processor) GetHandlers ¶
func (p *Processor) GetHandlers() map[string]asynq.HandlerFunc
GetHandlers returns the task handlers for this processor.
func (*Processor) ProcessNextBlock ¶
ProcessNextBlock processes the next available block.
func (*Processor) SetProcessingMode ¶
SetProcessingMode sets the processing mode for the processor.
type Transaction ¶
type Transaction struct {
UpdatedDateTime structlog.ClickHouseTime `json:"updated_date_time"`
BlockNumber uint64 `json:"block_number"`
BlockHash string `json:"block_hash"`
ParentHash string `json:"parent_hash"`
Position uint32 `json:"position"`
Hash string `json:"hash"`
From string `json:"from"`
To *string `json:"to"`
Nonce uint64 `json:"nonce"`
GasPrice string `json:"gas_price"` // Effective gas price as UInt128 string
Gas uint64 `json:"gas"` // Gas limit
GasTipCap *string `json:"gas_tip_cap"` // Nullable UInt128 string
GasFeeCap *string `json:"gas_fee_cap"` // Nullable UInt128 string
Value string `json:"value"` // UInt128 string
Type uint8 `json:"type"` // Transaction type
Size uint32 `json:"size"` // Transaction size in bytes
CallDataSize uint32 `json:"call_data_size"` // Size of call data
BlobGas *uint64 `json:"blob_gas"` // Nullable - for type 3 txs
BlobGasFeeCap *string `json:"blob_gas_fee_cap"` // Nullable UInt128 string
BlobHashes []string `json:"blob_hashes"` // Array of versioned hashes
Success bool `json:"success"`
NInputBytes uint32 `json:"n_input_bytes"`
NInputZeroBytes uint32 `json:"n_input_zero_bytes"`
NInputNonzeroBytes uint32 `json:"n_input_nonzero_bytes"`
MetaNetworkID int32 `json:"meta_network_id"`
MetaNetworkName string `json:"meta_network_name"`
}
Transaction represents a row in the execution_transaction table.
type VerifyPayload ¶
type VerifyPayload struct {
BlockNumber big.Int `json:"block_number"`
NetworkID int32 `json:"network_id"`
NetworkName string `json:"network_name"`
InsertedCount int `json:"inserted_count"`
}
VerifyPayload represents the payload for verifying a block.
func (*VerifyPayload) MarshalBinary ¶
func (v *VerifyPayload) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler.
func (*VerifyPayload) UnmarshalBinary ¶
func (v *VerifyPayload) UnmarshalBinary(data []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler.