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

*: move Notary contract out of P2PSigExtensions under Echidna hardfork #3478

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

AnnaShaleva
Copy link
Member

Close #3464. Fixes a couple of bugs connected with non-genesis native deploy process.

Depends on #3476 and neo-project/neo#3178, thus a draft.

@AnnaShaleva AnnaShaleva requested a review from roman-khimov June 5, 2024 15:46
@AnnaShaleva AnnaShaleva changed the title *: move Notary out of P2PSigExtensions under Domovoi hardfork *: move Notary contract out of P2PSigExtensions under Domovoi hardfork Jun 5, 2024
Copy link

codecov bot commented Jun 5, 2024

Codecov Report

Attention: Patch coverage is 87.01299% with 10 lines in your changes missing coverage. Please review.

Project coverage is 86.13%. Comparing base (c65d9f4) to head (8871165).
Report is 270 commits behind head on master.

Files with missing lines Patch % Lines
pkg/core/blockchain.go 45.45% 3 Missing and 3 partials ⚠️
pkg/config/hardfork_string.go 0.00% 2 Missing ⚠️
pkg/core/interop/context.go 0.00% 1 Missing ⚠️
pkg/core/native/management.go 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3478      +/-   ##
==========================================
+ Coverage   86.08%   86.13%   +0.04%     
==========================================
  Files         330      330              
  Lines       38641    38657      +16     
==========================================
+ Hits        33266    33299      +33     
+ Misses       3835     3821      -14     
+ Partials     1540     1537       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

It doesn't work for contracts enabled starting from non-nil hardfork:
```
--- FAIL: TestStateroot_GetLatestStateHeight (0.00s)
    logger.go:146: 2024-06-04T17:08:35.263+0300	INFO	initial gas supply is not set or wrong, setting default value	{"InitialGASSupply": "52000000"}
    logger.go:146: 2024-06-04T17:08:35.263+0300	INFO	mempool size is not set or wrong, setting default value	{"MemPoolSize": 50000}
    logger.go:146: 2024-06-04T17:08:35.263+0300	INFO	P2PNotaryRequestPayloadPool size is not set or wrong, setting default value	{"P2PNotaryRequestPayloadPoolSize": 1000}
    logger.go:146: 2024-06-04T17:08:35.263+0300	INFO	MaxBlockSize is not set or wrong, setting default value	{"MaxBlockSize": 262144}
    logger.go:146: 2024-06-04T17:08:35.263+0300	INFO	MaxBlockSystemFee is not set or wrong, setting default value	{"MaxBlockSystemFee": 900000000000}
    logger.go:146: 2024-06-04T17:08:35.263+0300	INFO	MaxTransactionsPerBlock is not set or wrong, using default value	{"MaxTransactionsPerBlock": 512}
    logger.go:146: 2024-06-04T17:08:35.263+0300	INFO	MaxValidUntilBlockIncrement is not set or wrong, using default value	{"MaxValidUntilBlockIncrement": 86400}
    logger.go:146: 2024-06-04T17:08:35.263+0300	INFO	Hardforks are not set, using default value
    logger.go:146: 2024-06-04T17:08:35.266+0300	INFO	no storage version found! creating genesis block
    chain.go:227:
        	Error Trace:	/home/anna/Documents/GitProjects/nspcc-dev/neo-go/pkg/neotest/chain/chain.go:227
        	            				/home/anna/Documents/GitProjects/nspcc-dev/neo-go/pkg/neotest/chain/chain.go:217
        	            				/home/anna/Documents/GitProjects/nspcc-dev/neo-go/pkg/services/stateroot/service_test.go:319
        	Error:      	Received unexpected error:
        	            	onPersist failed: VM has failed: at instruction 0 (SYSCALL): native contract descriptor cache is not initialized: contract c1e14f19c3e60d0b9244d06dd7ba9b113135ec3b, hardfork Default
        	Test:       	TestStateroot_GetLatestStateHeight
FAIL
coverage: 28.6% of statements

```

It happens because ActiveIn hardfork wasn't taken into account during
`latestHF` computation. This commit also removes the reusage of
`activeIn` variable in deploy procedure, it's misleading and not
necessary startign from #3444.

Signed-off-by: Anna Shaleva <[email protected]>
This code was never invoked since we had no native contract enabled
starting from some hardfork, Notary is the first one. And luckily, we
have plenty of tests that fail due to this bug.

Signed-off-by: Anna Shaleva <[email protected]>
Close #3464. Adjust tests, enable all hardforks for RPC server tests
starting from genesis.

Signed-off-by: Anna Shaleva <[email protected]>
Use `nativehashes.Notary instead of
(*Blockchain).GetNotaryContractScriptHash.

Signed-off-by: Anna Shaleva <[email protected]>
Move it under Domovoi hardfork.

Signed-off-by: Anna Shaleva <[email protected]>
@AnnaShaleva AnnaShaleva force-pushed the hf-dependant-notary branch from 551f9eb to 8871165 Compare July 15, 2024 10:53
@AnnaShaleva AnnaShaleva changed the title *: move Notary contract out of P2PSigExtensions under Domovoi hardfork *: move Notary contract out of P2PSigExtensions under Echidna hardfork Jul 15, 2024
@AnnaShaleva
Copy link
Member Author

Moved Notary functionality from Domovoi under Echidna hardfork.

@AnnaShaleva
Copy link
Member Author

Oh-oh, probably need to move it under next hardfork. Ref. #3554 and neo-project/neo#3454.

@roman-khimov
Copy link
Member

It still can be a part of Echidna. But for now we don't need to change anything anyway, it's totally C#-dependent.

@roman-khimov roman-khimov added the blocked Can't be done because of something label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Can't be done because of something
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move Notary contract under D hardfork
2 participants