-
Notifications
You must be signed in to change notification settings - Fork 79
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
Restrict maximum serialized NEF file size #3186
Conversation
03c6c32
to
4e07b73
Compare
Port neo-project/neo#2939. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
4e07b73
to
6ff0aa8
Compare
cli/smartcontract/smart_contract.go
Outdated
@@ -172,6 +172,10 @@ func NewCommands() []cli.Command { | |||
Name: "no-permissions", | |||
Usage: "do not check if invoked contracts are allowed in manifest", | |||
}, | |||
cli.BoolFlag{ | |||
Name: "no-nef-check", |
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.
@roman-khimov, what do you think about this option? You told earlier that it's hardly possible that someone needs large compiled contract that can not be deployed, so remove it?
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.
Looking at the current PR this has some substantial cost for us to maintain, so yeah, I'd drop it. Can be recreated if needed, but very very unlikely to.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3186 +/- ##
==========================================
+ Coverage 85.39% 85.41% +0.01%
==========================================
Files 326 326
Lines 43785 43806 +21
==========================================
+ Hits 37389 37415 +26
+ Misses 4922 4920 -2
+ Partials 1474 1471 -3 ☔ View full report in Codecov by Sentry. |
cli/smartcontract/smart_contract.go
Outdated
@@ -172,6 +172,10 @@ func NewCommands() []cli.Command { | |||
Name: "no-permissions", | |||
Usage: "do not check if invoked contracts are allowed in manifest", | |||
}, | |||
cli.BoolFlag{ | |||
Name: "no-nef-check", |
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.
Looking at the current PR this has some substantial cost for us to maintain, so yeah, I'd drop it. Can be recreated if needed, but very very unlikely to.
Retun an error if the serialized NEF size exceeds stackitem.MaxSize. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
6ff0aa8
to
90705e3
Compare
In this PR:
Ref. #3170 and depends on #3185. Draft until some real proximity to 0.104.0.