utils

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BlobsPerBlock uint64 = 6
View Source
var BuildRelease string
View Source
var BuildTime string
View Source
var BuildVersion string
View Source
var SecondsPerSlot uint64 = 12
View Source
var WeiPerGwei uint64 = 1000000000

Functions

func EtherToWei

func EtherToWei(val *uint256.Int) *uint256.Int

func GetBuildVersion

func GetBuildVersion() string

func ReadFileLinesTrimmed

func ReadFileLinesTrimmed(fname string) ([]string, error)

func RecoverPanic added in v1.1.3

func RecoverPanic(logger *logrus.Entry, routineName string) bool

func RunTransactionScenario added in v1.1.3

func RunTransactionScenario(ctx context.Context, options TransactionScenarioOptions) error

RunTransactionScenario executes a controlled transaction scenario with rate limiting and concurrency management. It processes transactions according to the specified options until either context cancellation or reaching TotalCount (if > 0).

Features: - Rate-limited execution based on Throughput - Optional dynamic throughput increases - Concurrency control via MaxPending - Sequential logging via transaction chaining

Returns an error only if the scenario cannot be started. Transaction failures should be handled within ProcessNextTxFn.

func WeiToEther

func WeiToEther(val *uint256.Int) *uint256.Int

Types

type FlexibleJsonUInt64 added in v1.1.2

type FlexibleJsonUInt64 uint64

func (*FlexibleJsonUInt64) UnmarshalJSON added in v1.1.2

func (f *FlexibleJsonUInt64) UnmarshalJSON(b []byte) error

func (*FlexibleJsonUInt64) UnmarshalYAML added in v1.1.2

func (f *FlexibleJsonUInt64) UnmarshalYAML(unmarshal func(interface{}) error) error

type TransactionScenarioOptions added in v1.1.3

type TransactionScenarioOptions struct {
	TotalCount                  uint64
	Throughput                  uint64
	MaxPending                  uint64
	ThroughputIncrementInterval uint64

	// Logger for scenario execution information
	Logger *logrus.Entry

	// ProcessNextTxFn handles transaction execution with the given index
	// It should return:
	// - A callback function to log transaction results (can be nil)
	// - An error if transaction creation failed
	// - The onComplete callback must be called when transaction processing is complete
	ProcessNextTxFn func(ctx context.Context, txIdx uint64, onComplete func()) (func(), error)
}

TransactionScenarioOptions configures how the transaction scenario is executed.

Jump to

Keyboard shortcuts

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