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

Get rid of effect group part in paging tokens #17

Merged
merged 1 commit into from
Jan 22, 2020

Conversation

charlie-wasp
Copy link
Collaborator

@charlie-wasp charlie-wasp commented Jan 20, 2020

Here's an attempt to get rid of EffectGroup component in our paging tokens (ids, in fact). It would help us to save some space on the disk

The idea is simple: trades indices start from the last balance effect index, so their ids won't overlap

Also, we had a little bug, which caused balances ids to have gaps. I fixed that in this PR too


This change is Reviewable

@gzigzigzeo
Copy link
Member

gzigzigzeo commented Jan 20, 2020

That shall work, but I have the concern: from what I understood, non-operation effects will have fake operation number in their IDs. That operation number would be last op index + 1. So, it would be impossible to figure out related operation without context, given you have effect ID value only. Would it not be better to have some reserved operation number for trade effects instead of last op index? Like, 9999 or 0? @charlie-wasp

@nebolsin
Copy link
Member

@gzigzigzeo tx-level effects (fees) will have operation Id 0, all other effects, including trades, are related to some operation, so there shouldn’t be any fake ids

@charlie-wasp
Copy link
Collaborator Author

@gzigzigzeo I am not sure that I fully understand your concern. I didn't introduce any fake operation numbers. I just made trade effects indices to start from the last balance effect index 🙂

Copy link
Member

@nebolsin nebolsin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@charlie-wasp LGTM, but please check that we correctly handling tx-level signer updates (happens automatically when pre-authorized tx is executed)

@charlie-wasp
Copy link
Collaborator Author

charlie-wasp commented Jan 21, 2020

@nebolsin that's interesting, on the tx-level only fee effects serialization is performed, no signers involved at all. I guess we have yet to implement this

UPDATE: here is exact code, which handles tx-level

https://github.com/astroband/astrologer/pull/17/files#diff-e58643b20d67a994fb21ad6ee79ee58fR41-R43

@charlie-wasp
Copy link
Collaborator Author

Well, I opened the issue about pre-authorized transactions — #18. I implement it in a separate PR, and now I'm merging this 🚢

@charlie-wasp charlie-wasp merged commit ac4a63a into master Jan 22, 2020
@charlie-wasp charlie-wasp deleted the play/remove-effect-group branch January 22, 2020 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants