Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Amxx opened this issue Aug 19, 2024 · 0 comments
Open
Labels

Comments

@Amxx
Copy link
Collaborator

Amxx commented Aug 19, 2024

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)

@Amxx Amxx added the idea label Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant