Skip to content

Remove last checkpoint when pushing an update that equals the the old value. #5152

Open
@Amxx

Description

@Amxx

Lets say we have a checkpoint trace that is

  • key: ..., value: ...
  • key: 100, value: 10

then we push key: 101, value: 20. This creates a new entry

  • key: ..., value: ...
  • key: 100, value: 10
  • key: 101, value: 20

then we push key: 101, value: 10. This updates the last new entry

  • key: ..., value: ...
  • key: 100, value: 10
  • key: 101, value: 10

Instead of updating the last entry, we should see that it equal the one before, and therefore we should probably delete the entry with key 101. This would add the invariant that "two consecutive checkpoints cannot have the same value"

This may usefull when some balance/delegation is affected by a flash loan or similar operation (in-out transfers that cancel out)

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