Skip to content

Remove blk field from BlockRef #3778

@arnetheduck

Description

@arnetheduck

stores a full copy of each block in memory - this block is used very rarely, ie only during replays.

A second copy of the same data is stored in txFrame as the block is serialized and persisted there after verification.

When there is a longer period of non-finality, this leads to high memory consumption. Instead:

  • remove blk from BlockRef and load it on demand from txFrame - this halves memory usage
  • eventually, flatten txFrame and keep it up to date using the heads structure, akin to how FcState does it - this way, almost no block payload data will be kept in memory.

#3628 implements this idea the other way around by keeping blk and removing it from txFrame - that approach however has almost no advantages and cannot be flattened.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions