Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

Use deltas for all edict fields #60

Closed
casey opened this issue Oct 10, 2023 · 3 comments · Fixed by ordinals/ord#2532
Closed

Use deltas for all edict fields #60

casey opened this issue Oct 10, 2023 · 3 comments · Fixed by ordinals/ord#2532

Comments

@casey
Copy link
Owner

casey commented Oct 10, 2023

Edict id, amount, and vout are all be deltas. Id is always a delta, amount is a delta if the ID is the same as the last, and output is a delta if the amount is the same as the last.

@sondotpin
Copy link

How Id can deltas?
what is delta of { height: 3, index 1} and { height: 5, index 3}

@casey
Copy link
Owner Author

casey commented Oct 12, 2023

Under realistic circumstances, a block will never have more than 2**16 transactions, so an ID can be encoded as a single number as height << 16 | index.

@casey casey added the later label Oct 12, 2023
@casey
Copy link
Owner Author

casey commented Oct 13, 2023

Edicts are processed in order, so we can't fully reorder them. However, we can reorder edicts by id. So it looks like the best bet is do delta encode edict IDs, but not amounts.

@casey casey linked a pull request Oct 13, 2023 that will close this issue
@casey casey removed the later label Oct 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants