Repository navigation
feat(platform)!: mitigate issues of asset lock based transitions - #1796
Conversation
| ) | ||
| } | ||
|
|
||
| pub fn required_asset_lock_balance_for_processing_start( |
There was a problem hiding this comment.
Shouldn't it be in Drive ABCI? We already have there similar traits
There was a problem hiding this comment.
Well it's just state transition + version, so DPP makes more sense.
There was a problem hiding this comment.
The problem is that StateTransition is represented all STs but this logic is specific for AssetLocks only. Also this logic is no needed in SDK. If think we had the same case in one of your previous PRs and we decided to move to ABCI sine we can't use AssetLockedProved trait and we don't want to polute API of common library.
| } | ||
|
|
||
| /// All of these penalty amounts are in credits | ||
| #[derive(Clone, Debug, Default)] |
There was a problem hiding this comment.
it's not a good idea to mix constants with versions. It's gonna be a mess at some point. Shouldn't they be operations?
There was a problem hiding this comment.
Because this tree is going to be too big since it mixes two different entities: versions and constants. If we want to have constants based on version I would introduce a separate tree for that.
There was a problem hiding this comment.
We can make a different PR for that, but we can even do it after mainnet, because it wouldn't be a breaking change.
| platform_version, | ||
| ) | ||
| } | ||
| _ => Ok(ConsensusValidationResult::new()), |
There was a problem hiding this comment.
Don't it should be an error since we do not suppose to call this function for other state transitions?
There was a problem hiding this comment.
I think the default being that it is passing if fine, because that validation would be "YES" by default, since an absence of checks would mean that all is good.
There was a problem hiding this comment.
Don't you think that double validation of our logic would be good. We will see bugs right away, I mean the functions what we are calling but not supposed to.
There was a problem hiding this comment.
No, this is fine.
There was a problem hiding this comment.
Remember we won't be including a lot of state transitions :)
…atform into feat/QueryAllCoreInfoTogether
|
Ivan had one issue that he wanted resolved that is still up for debate, either way this is a very big improvement, so we are going to merge this in and revisit the difference between deserialization in a different PR. |
Issue being fixed or feature implemented
Asset lock transactions (identity create and identity top) were extremely expensive on the system. Since asset locks could not be partially spent this meant that if they failed the system would be out of pocket for paying for expensive processing. This could have led to many types of attacks.
What was done?
Introduced the ability to partially use asset locks.
How Has This Been Tested?
Added a test where the identity create state transition is not valid, it gets rejected but still is paid for, and then we try to use it again and the identity then gets created.
Breaking Changes
Validation was changed, as well as some constants.
Checklist:
For repository code-owners and collaborators only