Skip to content

get-block-info should only return information for previous blocks #1164

Description

@jcnelson

Right now, get-block-info will allow a piece of Clarity code to query data about the current block. This should be blocked in the analysis pass, since it makes it nigh impossible for miners to identify valid transactions while packaging them into blocks. If the Clarity code is running at block N, then the code can only query metadata about blocks N - 1 or earlier. This also needs to apply to any time-warp code we write.

The reason for this constraint is because when packaging transactions together, a miner does not know the current burn header hash, the current block hash, or the current VRF seed. This means a miner cannot preemptively validate a transaction that depends on this information to execute. For example, if a transaction moves tokens conditionally depending on the current burn header hash, it could render a subsequent transaction in the block invalid (and the miner would have no way of knowing this in advance). Making it so the analysis pass rejects transactions that could query data about the current block avoids this problem.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions