Skip to content

Consider reducing the size of all structs #3

@BrendanChou

Description

@BrendanChou

Assume timestamps can fit into uint32 and tokenBalances and ethBalances can fit into uint128. The most unsafe assumption here is that tokenBalances fit into uint128, but you would be hard-pressed to find many actual tokens where this is not the case.

Then Account can take 1 storage slot instead of 2, Checkpoint can take 1 storage slot instead of 2, and Medianizer can fit tail, pendingStartTimestamp, and latestTimestamp into one storage slot.

This should dramatically reduce the gas costs of poke, possibly by up to 75% since SSTORE operations are likely the majority of the gas costs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions