Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Unified content block construction (WIP) #68

lrettig opened this issue Nov 17, 2021 · 0 comments

Unified content block construction (WIP) #68

lrettig opened this issue Nov 17, 2021 · 0 comments


Copy link

lrettig commented Nov 17, 2021


As part of the Spacemesh transaction selection and processing workflow (#50, #37), the Spacemesh protocol specifies that all of the proposals (submitted by eligible Smeshers in a given layer) be assembled into a single, unified content block (hereinafter referred to simply as the "block") for that layer. This proposal describes the deterministic algorithm by which this happens.

Goals and motivation

Specify a simple, deterministic algorithm that takes as input a set of valid proposals, each containing zero or more transactions, and outputs a single block of ordered transactions. Drop (i.e., do not include in output) transactions that are invalid or won't be effective (i.e., won't pay any gas) if possible.

High-level design

  • Take the union of all input transactions
  • Drop invalid transactions
  • Sort deterministically by principal, using a pseudorandom seed
  • Cluster transactions by principal and subsort by nonce
  • Drop duplicate transactions
  • Simulate execution of transactions, in order, against most recent known state (when/if known) and drop transactions that are ineffective
  • Assemble the filtered, sorted transactions into an output block

Prior art

Proposed implementation

Implementation plan


Dependencies and interactions

Stakeholders and reviewers

Testing and performance

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
None yet

No branches or pull requests

2 participants