-
Notifications
You must be signed in to change notification settings - Fork 993
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
Murisi/track undated assets #4303
base: main
Are you sure you want to change the base?
Conversation
55449e7
to
5778606
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Net of the failing tests and some minor things this PR looks good to me
@@ -437,7 +437,7 @@ pub trait ShieldedApi<U: ShieldedUtils + MaybeSend + MaybeSync>: | |||
async fn precompute_asset_types<C: Client + Sync>( | |||
&mut self, | |||
client: &C, | |||
tokens: Vec<&Address>, | |||
tokens: BTreeSet<&Address>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could just be an impl Iterator<Item=&Address>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. The motivation for this change was to try and avoid doing the same precomputation twice (with the redundant querying and encoding that comes with it) if the input contains duplicates, not that this is actually a serious problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some nits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have left a few suggestions, nothing too annoying to fix, I hope. Overall, this is a fine solution. The only thing I would point out is that it partitions the privacy set into dated and undated assets. After a shielding transaction is applied, you can tell whether the shielded asset was dated or not, based on the keys changed in storage. Whether this is relevant information or not isn't really clear to me.
EDIT: I guess this doesn't matter, because we could already tell before this PR if the asset was dated or not, given its presence or absence in the token map...
I think it doesn't really matter since that information is taken from the |
a8c2006
to
5d654d9
Compare
5d654d9
to
3ace08a
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4303 +/- ##
==========================================
+ Coverage 74.17% 74.25% +0.07%
==========================================
Files 345 343 -2
Lines 110624 110909 +285
==========================================
+ Hits 82060 82360 +300
+ Misses 28564 28549 -15 ☔ View full report in Codecov by Sentry. |
31d732a
to
af8d276
Compare
b0607df
to
fc618e5
Compare
fc618e5
to
0c0efd1
Compare
0c0efd1
to
ef4471d
Compare
Describe your changes
This PR attempts to address issue #4304 by distributing rewards only among the dated assets. Doing this involved tracking the balance of dated/undated assets in the MASP at any point in time. More specifically, the following changes have been made:
Checklist before merging
breaking::
labelsnamada-docs
reponamada-indexer
ornamada-masp-indexer
, a corresponding PR is opened in that repo