feat(applying): certificate and native script validation for ShelleyMA #510
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.
This PR implements checks for
for ShelleyMA. This also required a revision of
check_preservation_of_value
to take care of pool deposits and the like. (The implementation of native scripts has also been been tested at Alonzo, but will be included in a future PR).I tried to follow the specs for the Shelley and Mary ledgers. In order to do this, I implemented (with guidance by Gadea) some of the relevant types that describe the “states” related by the different transition relations governing the ledger (see
utils.rs
); v.g.DState
records key delegations and pointers, etc.Breaking change
In order to make use of the new checks,
validate_shelley_ma_tx
(and hencevalidate
, which has been renamed tovalidate_txs
and takes a list of transactions) must maintain (and modify) those states, and hence the type signature differs from the original one.API
The original (mutable)
state
must be preserved before checking a tx (e.g. at Dolos) withvalidate_txs
:This is because the buffer state will end up inconsistent in case of a validation error.
Tests
Eight new unit tests (four positive and four negative) were added.