ChainSafe / ChainSafe/gossamer

use transaction weights to optimally fill a block when building

Open
#2,183 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
454
Forks
144
PR merge metrics
No merged PRs in 30d

Description

## Task summary

- gossamer should optimally fill a block with transactions when building a block
- this means it should get as close to the block weight limit as possible, while respecting the block size limit (in bytes)
- every transaction already has a weight associated to it (calculated in the validate_transaction step), so we need to create an algorithm that will determine which txs to include in the next block (ie. which to put into the tx queue)
- this should be implemented via the "move from tx pool to queue" function; txs should be moved from the pool to the queue on the basis of this "upcoming tx selection" algorithm

## Specification reference

- see [spec chapter 8](https://w3f.github.io/polkadot-spec/develop/_weights.html)
- block size limit = 5,242,880 bytes (Def 13)
- block weight limit = 2,000,000,000,000 (Def 15)

## Other information and links

-

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.