fix: check pledges against changes being made #181
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Validate the changes made after running the WASM to make sure that all the shards have pledged it correctly.
Also fixes a bug where the DOWN and the UP of a component were not created.
Motivation and Context
This is a critical check that all committees are prepared to make the changes to the involved shards when the data is finally committed.
Note that there are quite a few ugly implementation details here. The substate change map is inelegant by using a
match
instead of anif
because of the inner data in the Substate. There are already a number of changes in this PR and I'm worried that it will cause conflicts with other PRs. I'll return to clean up that code after this and the other changes are mergedHow Has This Been Tested?
Manually. Calling the Counter::increase method now creates a DOWN and an UP row in the sqlite db