Skip to content
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

Merged
merged 2 commits into from
Nov 20, 2023
Merged

Conversation

AnnaShaleva
Copy link
Member

@AnnaShaleva AnnaShaleva commented Nov 2, 2023

In this PR:

Ref. #3170 and depends on #3185. Draft until some real proximity to 0.104.0.

@AnnaShaleva AnnaShaleva added smartcontract Smart contracts and associated package enhancement Improving existing functionality cli Command line interface labels Nov 2, 2023
@AnnaShaleva AnnaShaleva added this to the v0.104.0 milestone Nov 2, 2023
Port neo-project/neo#2939.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
@AnnaShaleva AnnaShaleva marked this pull request as ready for review November 20, 2023 11:32
@@ -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",
Copy link
Member Author

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?

Copy link
Member

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.

Copy link

codecov bot commented Nov 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b220594) 85.39% compared to head (90705e3) 85.41%.
Report is 5 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

@@ -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",
Copy link
Member

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.

pkg/compiler/compiler.go Outdated Show resolved Hide resolved
pkg/smartcontract/nef/nef.go Show resolved Hide resolved
pkg/smartcontract/nef/nef.go Outdated Show resolved Hide resolved
pkg/smartcontract/nef/nef.go Outdated Show resolved Hide resolved
Retun an error if the serialized NEF size exceeds stackitem.MaxSize.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
@roman-khimov roman-khimov merged commit 7fb077e into master Nov 20, 2023
16 of 18 checks passed
@roman-khimov roman-khimov deleted the reduce-max-nef-size branch November 20, 2023 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Command line interface enhancement Improving existing functionality smartcontract Smart contracts and associated package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants