-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Set attribute fee #2916
Set attribute fee #2916
Conversation
A nice generalization. I think NotaryAssisted (from #2896) will fit into this scheme easily as well (the value could be removed from the Notary contract, doesn't matter much which contract stores it). @AnnaShaleva? |
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.
Really nice idea, I like it!
Sure. |
Co-authored-by: Anna Shaleva <[email protected]>
Co-authored-by: Anna Shaleva <[email protected]>
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.
LGTM.
@superboyiii could you test it? |
Port the neo-project/neo#2916. Signed-off-by: Anna Shaleva <[email protected]>
Port the neo-project/neo#2916. Signed-off-by: Anna Shaleva <[email protected]>
Port the neo-project/neo#2916. Signed-off-by: Anna Shaleva <[email protected]>
Sure |
Port the neo-project/neo#2916. Signed-off-by: Anna Shaleva <[email protected]>
Port the neo-project/neo#2916. Signed-off-by: Anna Shaleva <[email protected]>
Port the neo-project/neo#2916. Signed-off-by: Anna Shaleva <[email protected]>
Port the neo-project/neo#2916. Signed-off-by: Anna Shaleva <[email protected]>
Tested. Good enough, let's move on. @shargon |
@shargon, it looks like this is the same case as KECAK. If this is merged like this without tag there are possibilities for attacks. Who will be responsible to monitor all CN upgrade for that and check if the syscal was not used? |
This is a fix for a public exploit. |
The origin of the exploit is also another problem as you known. The Conflict PR was not ready. At least, upgrade the nodes now and release a version that CN will upgrade. Do not postpone it. |
Port the neo-project/neo#2916. Signed-off-by: Anna Shaleva <[email protected]>
Port the neo-project/neo#2916. Signed-off-by: Anna Shaleva <[email protected]>
Port the neo-project/neo#2916. Signed-off-by: Anna Shaleva <[email protected]>
ConflictsFee logic was replaced by the generic attribute fee mechanism implemented in neo-project#2916. Signed-off-by: Anna Shaleva <[email protected]>
Port the neo-project/neo#2916. Signed-off-by: Anna Shaleva <[email protected]>
* Ledger: change conflict records storage scheme This commit is a part of #2907: it implements conflict records storage scheme discribed in #2907 (comment). The short scheme description: Do not store the list of conflicting signers in the Ledger's conflict record value. Instead, put each conflicting signer in the conflict record key so that the reculting key is: {Prefix_Transaction, <conflict hash>, <signer>}, and the value is {<block index>}. As an optimisation, for each conflict record store the dummy stub where the key is {Prefix_Transaction, <conflict hash>} and the value is {<block index>}. This optimisation allows to reduce DB read requests during newly-pooled transaction verification for those transactions that do not have any on-chained conflicts. Also, IsTraceableBlock check is added for on-chain conflicts verification. It is needed to avoid situations when untraceable on-chained conflict affects the newly-pooled transaction verification. Signed-off-by: Anna Shaleva <[email protected]> * UT_MemoryPool: remove unused test Malicious_OnChain_Conflict was constructed incorrectly (see the comment in the end of the test) and was replaced by the proper TestMaliciousOnChainConflict test in UT_Blockchain.cs way back ago in 0c06c91. Signed-off-by: Anna Shaleva <[email protected]> * Policy: introduce fee for Conflicts attribute This commit implements Conflicts attribute policy described in #2907 (comment). Signed-off-by: Anna Shaleva <[email protected]> * *: remove remnants of ConflictsFee in native Policy ConflictsFee logic was replaced by the generic attribute fee mechanism implemented in #2916. Signed-off-by: Anna Shaleva <[email protected]> * Native: do not remove malicious conflict records during OnPersist It's OK to keep them and save O(n) operations during OnPersist. The storage taken by these malicious conflict records is properly paid anyway. See the discussion under #2913 (comment). Signed-off-by: Anna Shaleva <[email protected]> * Properly rewrite previously added malicious conflict if it's in the storage `engine.Snapshot.Add` doesn't allow to rewrite storage entity if it's already exist. Thus, we firstly need to remove it and afterwards to add the updated entity. Signed-off-by: Anna Shaleva <[email protected]> * Throw proper exception if TestMaliciousOnChainConflict fails Signed-off-by: Anna Shaleva <[email protected]> * Optimize conflicts records storing Use Snapshot.GetAndChange instead of subsequent calls to Delete and Add. Ref. #2913 (comment). Signed-off-by: Anna Shaleva <[email protected]> --------- Signed-off-by: Anna Shaleva <[email protected]> Co-authored-by: Shargon <[email protected]> Co-authored-by: Jimmy <[email protected]>
Port the neo-project/neo#2916. Signed-off-by: Anna Shaleva <[email protected]>
Port the neo-project/neo#2916. Signed-off-by: Anna Shaleva <[email protected]>
Port the neo-project/neo#2916. Signed-off-by: Anna Shaleva <[email protected]>
Port the neo-project/neo#2916. Signed-off-by: Anna Shaleva <[email protected]>
Port the neo-project/neo#2916. Signed-off-by: Anna Shaleva <[email protected]>
Port the neo-project/neo#2916. Signed-off-by: Anna Shaleva <[email protected]>
First part of #2913
Idea of @AnnaShaleva