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

core: rework natives cache initialization #2994

Merged
merged 3 commits into from
Apr 26, 2023
Merged

Conversation

AnnaShaleva
Copy link
Member

Close #2984.

Make the contracts cache initialization unified. The order of cache
iniitialization is not important and Nottary contract is added to the
bc.contracts.Contracts wrt P2PSigExtensions setting, thus no functional
changes, just refactoring for future applications.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
If the contract was deployed then cache must be initialized after
in-memory data reset. If the contract isn't active yet, then no
cache will be initialized on deploy (i.e. on call to Initialize()
method by native Management).

Close #2984.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
Otherwise it will cause panic, which isn't expected behaviour.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
@codecov
Copy link

codecov bot commented Apr 26, 2023

Codecov Report

Merging #2994 (67d4d89) into master (bbdfdc3) will increase coverage by 0.09%.
The diff coverage is 82.50%.

@@            Coverage Diff             @@
##           master    #2994      +/-   ##
==========================================
+ Coverage   84.77%   84.86%   +0.09%     
==========================================
  Files         328      328              
  Lines       43050    43059       +9     
==========================================
+ Hits        36496    36544      +48     
+ Misses       5067     5028      -39     
  Partials     1487     1487              
Impacted Files Coverage Δ
pkg/core/interop/context.go 92.03% <ø> (ø)
pkg/core/native/native_neo.go 82.13% <ø> (ø)
pkg/core/blockchain.go 78.37% <69.56%> (+0.43%) ⬆️
pkg/core/native/crypto.go 63.68% <100.00%> (+0.19%) ⬆️
pkg/core/native/designate.go 82.18% <100.00%> (ø)
pkg/core/native/ledger.go 92.02% <100.00%> (+0.09%) ⬆️
pkg/core/native/management.go 92.55% <100.00%> (ø)
pkg/core/native/native_gas.go 75.51% <100.00%> (+0.51%) ⬆️
pkg/core/native/notary.go 92.16% <100.00%> (ø)
pkg/core/native/oracle.go 73.55% <100.00%> (+0.07%) ⬆️
... and 3 more

... and 7 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@roman-khimov roman-khimov merged commit 1bd22ad into master Apr 26, 2023
@roman-khimov roman-khimov deleted the fix-init-cache branch April 26, 2023 11:54
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.

.docker: Nodes panicked on env restart
2 participants