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

Manifest and script checks #1729

Merged
merged 19 commits into from
Feb 10, 2021
Merged

Manifest and script checks #1729

merged 19 commits into from
Feb 10, 2021

Conversation

roman-khimov
Copy link
Member

Problem

#1699.

Solution

Merge.

It was used when manifests were saved into JSON.
Make it a little more convenient to work with it.
Some methods must be defined in a valid ABI. Refs. neo-project/neo#2263.
Strange as it is but I wasn't able to find any good bit field
implementation. Most of them are limited to 64 bits, some allow for wider
values (like https://github.com/emef/bitfield) but even they're not that
efficient (using bytes instead of wider types). This this minimalistic thing.
@codecov
Copy link

codecov bot commented Feb 9, 2021

Codecov Report

Merging #1729 (dd05cae) into master (1f98289) will increase coverage by 0.20%.
The diff coverage is 95.51%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1729      +/-   ##
==========================================
+ Coverage   82.53%   82.73%   +0.20%     
==========================================
  Files         255      261       +6     
  Lines       21532    21765     +233     
==========================================
+ Hits        17772    18008     +236     
+ Misses       2657     2651       -6     
- Partials     1103     1106       +3     
Impacted Files Coverage Δ
pkg/smartcontract/manifest/group.go 78.57% <78.57%> (ø)
pkg/core/native/management.go 87.78% <90.00%> (-0.02%) ⬇️
pkg/vm/vm.go 94.06% <90.00%> (+0.09%) ⬆️
pkg/vm/contract_checks.go 85.57% <94.59%> (+4.97%) ⬆️
pkg/core/blockchain.go 76.67% <100.00%> (+0.21%) ⬆️
pkg/crypto/keys/publickey.go 85.55% <100.00%> (+0.55%) ⬆️
pkg/smartcontract/manifest/abi.go 100.00% <100.00%> (ø)
pkg/smartcontract/manifest/event.go 100.00% <100.00%> (ø)
pkg/smartcontract/manifest/manifest.go 97.63% <100.00%> (+6.36%) ⬆️
pkg/smartcontract/manifest/method.go 91.83% <100.00%> (+1.43%) ⬆️
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1f98289...dd05cae. Read the comment docs.

case PermissionWildcard:
bad = true
case PermissionHash:
if contracts[i].Hash() == contracts[j].Hash() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bad = contracts[i].Hash() == contracts[j].Hash() ?

}

// Equals compares two Fields and returns true if they're equal.
func (f Field) Equals(o Field) bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd expect it to compare f to o as sets (as len guarantee can't be provided fully because of upper-rounding in New). But if we don't need this, ok.

@roman-khimov roman-khimov merged commit 7c419ce into master Feb 10, 2021
@roman-khimov roman-khimov deleted the manifest-and-script-checks branch February 10, 2021 17:58
AnnaShaleva added a commit that referenced this pull request Jul 4, 2023
This check is good and was present here since #1729, but it was
accidently removed from the reference implementation (see the
discussion in neo-project/neo#2848). The
removal of this check from the C# node leaded to the T5 testnet state
diff since 1670095 heigh which causes inability to process new blocks
since 2272533 height (see #3049). This check was added back to the
C# node in neo-project/neo#2849, but it is
planned to be the part of the upcoming 3.6.0 C# node release.

We need to keep our testnet healthy, thus, strict contract script
check will be temporary removed from the node code and is planned
to be added back to be a part of the next 3.6.0-compatible release.

Close #3049.
AnnaShaleva added a commit that referenced this pull request Jul 4, 2023
This check is good and was present here since #1729, but it was
accidently removed from the reference implementation (see the
discussion in neo-project/neo#2848). The
removal of this check from the C# node leaded to the T5 testnet state
diff since 1670095 heigh which causes inability to process new blocks
since 2272533 height (see #3049). This check was added back to the
C# node in neo-project/neo#2849, but it is
planned to be the part of the upcoming 3.6.0 C# node release.

We need to keep our testnet healthy, thus, strict contract script
check will be temporary removed from the node code and is planned
to be added back to be a part of the next 3.6.0-compatible release.

Close #3049.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
AnnaShaleva added a commit that referenced this pull request Jul 4, 2023
This check is good and was present here since #1729, but it was
accidently removed from the reference implementation (see the
discussion in neo-project/neo#2848). The
removal of this check from the C# node leaded to the T5 testnet state
diff since 1670095 heigh which causes inability to process new blocks
since 2272533 height (see #3049). This check was added back to the
C# node in neo-project/neo#2849, but it is
planned to be the part of the upcoming 3.6.0 C# node release.

We need to keep our testnet healthy, thus, strict contract script
check will be temporary removed from the node code and is planned
to be added back to be a part of the next 3.6.0-compatible release.

Close #3049.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
AnnaShaleva added a commit that referenced this pull request Jul 8, 2023
This check is good and was present here since #1729, but it was
accidently removed from the reference implementation (see the
discussion in neo-project/neo#2848). The
removal of this check from the C# node leaded to the T5 testnet state
diff since 1670095 heigh which causes inability to process new blocks
since 2272533 height (see #3049). This check was added back to the
C# node in neo-project/neo#2849, but it is
planned to be the part of the upcoming 3.6.0 C# node release.

We need to keep our testnet healthy, thus, strict contract script
check will be temporary removed from the node code and is planned
to be added back to be a part of the next 3.6.0-compatible release.

Close #3049.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants