core: restrict the number of allowed SC notifications#3640
Merged
roman-khimov merged 1 commit intomasterfrom Mar 7, 2025
Merged
core: restrict the number of allowed SC notifications#3640roman-khimov merged 1 commit intomasterfrom
roman-khimov merged 1 commit intomasterfrom
Conversation
Member
roman-khimov
left a comment
There was a problem hiding this comment.
Works for me, but we need some broader discussion, maybe even neo-project/neo#3547
AnnaShaleva
added a commit
to neo-project/neo
that referenced
this pull request
Oct 23, 2024
Fix the problem described in nspcc-dev/neo-go#3490. Port the solution from nspcc-dev/neo-go#3640. MaxNotificationsCount constraint is chosen based on the Mainnet statistics of the number of notifications per every transaction, ref. nspcc-dev/neo-go#3490 (comment). Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
10 tasks
Member
Author
|
Ref. neo-project/neo#3548. |
NGDAdmin
added a commit
to neo-project/neo
that referenced
this pull request
Mar 5, 2025
* add hardofork HF_Echidna * Add entries to `Designation` event (#3397) * Add entries to Designation event * Change to HF_Echidna * Add UT * Add count * [Neo Core StdLib] Add Base64url (#3453) * add base64url * active in * update placehold hf height * fix hf issue and move methods to proper place. * fix test * use identifymodel instead. * add hardofork HF_Echidna * Add entries to `Designation` event (#3397) * Add entries to Designation event * Change to HF_Echidna * Add UT * Add count * [Neo Core StdLib] Add Base64url (#3453) * add base64url * active in * update placehold hf height * fix hf issue and move methods to proper place. * fix test * use identifymodel instead. * SmartContract: restrict the number of allowed notifications Fix the problem described in nspcc-dev/neo-go#3490. Port the solution from nspcc-dev/neo-go#3640. MaxNotificationsCount constraint is chosen based on the Mainnet statistics of the number of notifications per every transaction, ref. nspcc-dev/neo-go#3490 (comment). Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru> * SmartContract: fix format Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru> * Update src/Neo/SmartContract/ApplicationEngine.Runtime.cs * Avoid notification creation * add hardofork HF_Echidna * Add entries to `Designation` event (#3397) * Add entries to Designation event * Change to HF_Echidna * Add UT * Add count * [Neo Core StdLib] Add Base64url (#3453) * add base64url * active in * update placehold hf height * fix hf issue and move methods to proper place. * fix test * use identifymodel instead. * format * Fixed typo * Added back #3397 * fix format * Update src/Neo/SmartContract/Native/RoleManagement.cs * Neo.CLI: revert configuration changes Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru> --------- Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru> Co-authored-by: Jimmy <jinghui@wayne.edu> Co-authored-by: Shargon <shargon@gmail.com> Co-authored-by: Christopher Schuchardt <cschuchardt88@gmail.com> Co-authored-by: NGD Admin <154295625+NGDAdmin@users.noreply.github.com>
e4965cf to
d3d1920
Compare
AnnaShaleva
commented
Mar 6, 2025
| // HFEchidna represents hard-fork introduced in #3554 (ported from | ||
| // https://github.com/neo-project/neo/pull/3454). | ||
| // https://github.com/neo-project/neo/pull/3454), #3640 (ported from | ||
| // https://github.com/neo-project/neo/pull/3548). |
Member
Author
There was a problem hiding this comment.
I will fix this list in a separate PR, we stil have some Echidna-related changes unmerged, so I'll review it anyway.
roman-khimov
reviewed
Mar 6, 2025
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3640 +/- ##
==========================================
- Coverage 82.88% 82.74% -0.14%
==========================================
Files 338 338
Lines 47448 47484 +36
==========================================
- Hits 39326 39290 -36
- Misses 6502 6563 +61
- Partials 1620 1631 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Close #3490. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
roman-khimov
approved these changes
Mar 7, 2025
cschuchardt88
added a commit
to cschuchardt88/neo
that referenced
this pull request
Jun 8, 2025
…ect#3548) * add hardofork HF_Echidna * Add entries to `Designation` event (neo-project#3397) * Add entries to Designation event * Change to HF_Echidna * Add UT * Add count * [Neo Core StdLib] Add Base64url (neo-project#3453) * add base64url * active in * update placehold hf height * fix hf issue and move methods to proper place. * fix test * use identifymodel instead. * add hardofork HF_Echidna * Add entries to `Designation` event (neo-project#3397) * Add entries to Designation event * Change to HF_Echidna * Add UT * Add count * [Neo Core StdLib] Add Base64url (neo-project#3453) * add base64url * active in * update placehold hf height * fix hf issue and move methods to proper place. * fix test * use identifymodel instead. * SmartContract: restrict the number of allowed notifications Fix the problem described in nspcc-dev/neo-go#3490. Port the solution from nspcc-dev/neo-go#3640. MaxNotificationsCount constraint is chosen based on the Mainnet statistics of the number of notifications per every transaction, ref. nspcc-dev/neo-go#3490 (comment). Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru> * SmartContract: fix format Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru> * Update src/Neo/SmartContract/ApplicationEngine.Runtime.cs * Avoid notification creation * add hardofork HF_Echidna * Add entries to `Designation` event (neo-project#3397) * Add entries to Designation event * Change to HF_Echidna * Add UT * Add count * [Neo Core StdLib] Add Base64url (neo-project#3453) * add base64url * active in * update placehold hf height * fix hf issue and move methods to proper place. * fix test * use identifymodel instead. * format * Fixed typo * Added back neo-project#3397 * fix format * Update src/Neo/SmartContract/Native/RoleManagement.cs * Neo.CLI: revert configuration changes Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru> --------- Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru> Co-authored-by: Jimmy <jinghui@wayne.edu> Co-authored-by: Shargon <shargon@gmail.com> Co-authored-by: Christopher Schuchardt <cschuchardt88@gmail.com> Co-authored-by: NGD Admin <154295625+NGDAdmin@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Close #3490.
@roman-khimov, what do you think? Another option is to cache size for every emitted notification and then check the overall notifications size every time we're going to emit one more notification, it also may be implemented.
I'll add more tests once we agree on solution.