Skip to content

Check for State Modification from Extrinsic Errors on Syncing Nodes #325

Closed
@shawntabrizi

Description

@shawntabrizi

A rule of all extrinsics should be that if it results in an error, it does not modify state. This is the "Check First, Write Last" rule.

We try out best to do this in all the various runtime unit tests, but it is very likely the we or other Substrate builders have missed some.

I suggest we add a feature flag that any syncing node can add to their chain which will process the blocks per extrinsic, check the state root before, run the extrinsic, see if it returns error, and then check the state root after.

If this occurs, then we may have a problem in the runtime code, and it should emit a WARNING or ERROR log which we can monitor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A2-stalePull request did not receive any updates in a long time. No review needed at this stage. Close it.D1-mediumCan be fixed by a coder with good Rust knowledge but little knowledge of the codebase.T1-FRAMEThis PR/Issue is related to core FRAME, the framework.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions