Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultMaxCollectionSize uint = 100 // max 100 transactions per collection DefaultExpiryBuffer uint = 15 // 15 blocks for collections to be included DefaultMaxPayerTransactionRate float64 = 0 // no rate limiting DefaultMaxCollectionByteSize uint64 = 1750000 // ~1.75MB. This is slightly higher than the limit on single tx size, which is 1.5MB DefaultMaxCollectionTotalGas uint64 = 10000000 // 10M )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder is the builder for collection block payloads. Upon providing a payload hash, it also memorizes the payload contents.
NOTE: Builder is NOT safe for use with multiple goroutines. Since the HotStuff event loop is the only consumer of this interface and is single threaded, this is OK.
func NewBuilder ¶
type Config ¶ added in v0.11.0
type Config struct { // MaxCollectionSize is the maximum size of collections. MaxCollectionSize uint // ExpiryBuffer is how much buffer we add when considering transaction // expiry. If the buffer is set to 10, and a transaction actually expires // in 15 blocks, we consider it expired in 5 (15-10) blocks. This accounts // for the time between the collection being built and being included in // block. ExpiryBuffer uint // MaxPayerTransactionRate is the maximum number of transactions per payer // per collection. Fractional values greater than 1 are rounded down. // Fractional values 0<k<1 mean that only 1 transaction every ceil(1/k) // collections is allowed. // // A negative value or 0 indicates no rate limiting. MaxPayerTransactionRate float64 // UnlimitedPayer is a set of addresses which are not affected by per-payer // rate limiting. UnlimitedPayers map[flow.Address]struct{} // MaxCollectionByteSize is the maximum byte size of a collection. MaxCollectionByteSize uint64 // MaxCollectionTotalGas is the maximum of total of gas per collection (sum of maxGasLimit over transactions) MaxCollectionTotalGas uint64 }
Config is the configurable options for the collection builder.
func DefaultConfig ¶ added in v0.11.0
func DefaultConfig() Config
type Opt ¶
type Opt func(config *Config)
func WithExpiryBuffer ¶
func WithMaxCollectionByteSize ¶ added in v0.11.0
func WithMaxCollectionSize ¶
func WithMaxCollectionTotalGas ¶ added in v0.11.0
func WithMaxPayerTransactionRate ¶ added in v0.11.0
func WithUnlimitedPayers ¶ added in v0.11.0
Click to show internal directories.
Click to hide internal directories.