-
Notifications
You must be signed in to change notification settings - Fork 56
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
Replace TxAccountUpdate
and BlockAccountUpdate
with AccountUpdate
#1099
Conversation
047afbd
to
1878efe
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.
Looks good! Thank you! No specific comments - but I did want to bring up one point:
The main reason why TxAccountUpdate
and BlockAccountUpdate
were different is that for BlockAccountUpdate
we didn't track the initial state of the account because it was retrieved from the database during block building. So, technically now the block includes some data that is not really needed.
Maybe that's fine, but wanted to bring it up to make sure we make a conscious decision on this. Or maybe there is a way to make it work somehow for both use cases.
Good point. I glossed over this a bit while implementing this. One way to fix this would be to remove the initial state commitment from the pub struct TraceableAccountUpdate {
/// Commitment to the state of the account before this update is applied.
///
/// Equal to `Digest::default()` for new accounts.
initial_state_commitment: Digest,
update: AccountUpdate,
} One small issue is that the list of transactions that contributed to an account update is also unnecessary for the So there are some minor things that make me now think the cleanest solution is to just keep the individual types and have one for tx, batch and block account updates. |
I'm fine with this. We may come back to a unified |
Agreed. Closing the PR. |
Replace
TxAccountUpdate
andBlockAccountUpdate
withAccountUpdate
.With the introduction of the batch kernel we would possibly need a third
BatchAccountUpdate
type which would look similar to the existing account update types, so it seemed useful to refactor the existing two into a single type that will also be usable for the batch kernel.This uses the terminology of commitment over hash, i.e.
final_state_commitment
rather thanfinal_state_hash
. This is in anticipation of #1092 to avoid extra work when implementing that PR.Part of #1095.