-
Notifications
You must be signed in to change notification settings - Fork 87
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
Store the base asset id in the metadata #781
Conversation
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.
Why do we need to get the asset id without consensus params?
This seems like a harmless change, but it's also redundant, so I just want to understand the justification. It's not like the base asset will be different for txs in a block or likely ever change for the chain.
It is possible to change the base asset id via consensus parameters. While checked transactions live inside of the memory pool, consensus parameters could change. When we try to ask for a transaction about its base asset balance, it will return the wrong value. Another reason for the change is to make the Taking into account that each time to get the latest consensus parameters, we need to lock and clone the consensus parameters from the cache, it will not affect performance. |
But we don't want to let a tx submitter just choose some arbitrary base asset. I guess we are going to still check that the base asset is correct for the block when we call |
The TX submitter can't choose it. We cached the value from consensus parameters. The In the same way, we could just case |
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.
Looks good assuming we implement the things we talked about offline.
Having the base asset id allows to get the base asset balance by just using metadata without consensus parameters.
Before requesting review