Skip to content

native: move MaxValidUntilBlockIncrement to Policy#3849

Merged
roman-khimov merged 3 commits intomasterfrom
policy-extension
Apr 10, 2025
Merged

native: move MaxValidUntilBlockIncrement to Policy#3849
roman-khimov merged 3 commits intomasterfrom
policy-extension

Conversation

@AnnaShaleva
Copy link
Member

@AnnaShaleva AnnaShaleva commented Mar 26, 2025

A part of #3841. Port neo-project/neo#3861.

@AnnaShaleva AnnaShaleva force-pushed the policy-extension branch 2 times, most recently from d2d91f1 to 3d1c143 Compare March 28, 2025 17:47
@AnnaShaleva
Copy link
Member Author

@roman-khimov, MaxVUBIncrement change relatively simple, but MaxTraceableBlocks is a little bit more unobvious, there's a couple of places where "hacks" need to be used to properly handle some situations. Take a look at the TODO comments, please.

@codecov
Copy link

codecov bot commented Mar 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.56%. Comparing base (3f79238) to head (287e914).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3849      +/-   ##
==========================================
+ Coverage   82.54%   82.56%   +0.01%     
==========================================
  Files         342      342              
  Lines       47970    48023      +53     
==========================================
+ Hits        39599    39648      +49     
- Misses       6735     6737       +2     
- Partials     1636     1638       +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AnnaShaleva AnnaShaleva changed the title native: move MaxTraceableBlocks and MaxValidUntilBlockIncrement to Policy native: move MaxValidUntilBlockIncrement to Policy Mar 31, 2025
@AnnaShaleva
Copy link
Member Author

Let's use this PR for MaxValidUntilBlockIncrement change only, I'll move MaxTraceableBlocks related changes to another PR.

AnnaShaleva added a commit to neo-project/neo that referenced this pull request Mar 31, 2025
The problem is described in
nspcc-dev/neo-go#3841. In short words,
the chain's state is dependent on MaxValidUntilBlockIncrement setting,
whereas this setting depends on the block time. Since block generation
time is a part of native Policy (#3622), MaxValidUntilBlockIncrement
should follow, we need the same value to be applied at all CNs
simultaneously.

Port nspcc-dev/neo-go#3849.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
AnnaShaleva added a commit to neo-project/neo that referenced this pull request Mar 31, 2025
The problem is described in
nspcc-dev/neo-go#3841. In short words,
the chain's state is dependent on MaxValidUntilBlockIncrement setting,
whereas this setting depends on the block time. Since block generation
time is a part of native Policy (#3622), MaxValidUntilBlockIncrement
should follow, we need the same value to be applied at all CNs
simultaneously.

Port nspcc-dev/neo-go#3849.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
@AnnaShaleva AnnaShaleva added the blocked Can't be done because of something label Apr 1, 2025
NGDAdmin pushed a commit to neo-project/neo that referenced this pull request Apr 10, 2025
* Native: move MaxValidUntilBlockIncrement to native Policy

The problem is described in
nspcc-dev/neo-go#3841. In short words,
the chain's state is dependent on MaxValidUntilBlockIncrement setting,
whereas this setting depends on the block time. Since block generation
time is a part of native Policy (#3622), MaxValidUntilBlockIncrement
should follow, we need the same value to be applied at all CNs
simultaneously.

Port nspcc-dev/neo-go#3849.

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

* Extensions: improve formatting

No functional changes.

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

* Native: set maximum constraint for MaxValidUntilBlockIncrement

It's set to be a day of 1-second blocks, that should be enough, ref.
#3861 (comment).

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

---------

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
Co-authored-by: Shargon <shargon@gmail.com>
Co-authored-by: Will <201105916+Wi1l-B0t@users.noreply.github.com>
Co-authored-by: Christopher Schuchardt <cschuchardt88@gmail.com>
Co-authored-by: Jimmy <jinghui@wayne.edu>
@AnnaShaleva AnnaShaleva force-pushed the policy-extension branch 3 times, most recently from e3eeaf5 to e481f71 Compare April 10, 2025 11:21
A part of #3841.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
@AnnaShaleva AnnaShaleva removed the blocked Can't be done because of something label Apr 10, 2025
@AnnaShaleva AnnaShaleva marked this pull request as ready for review April 10, 2025 11:28
@roman-khimov roman-khimov merged commit 193d3a6 into master Apr 10, 2025
34 checks passed
@roman-khimov roman-khimov deleted the policy-extension branch April 10, 2025 15:00
AnnaShaleva added a commit that referenced this pull request Apr 23, 2025
Should be a part of #3849 and
#3835.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
cschuchardt88 added a commit to cschuchardt88/neo that referenced this pull request Jun 8, 2025
…ect#3861)

* Native: move MaxValidUntilBlockIncrement to native Policy

The problem is described in
nspcc-dev/neo-go#3841. In short words,
the chain's state is dependent on MaxValidUntilBlockIncrement setting,
whereas this setting depends on the block time. Since block generation
time is a part of native Policy (neo-project#3622), MaxValidUntilBlockIncrement
should follow, we need the same value to be applied at all CNs
simultaneously.

Port nspcc-dev/neo-go#3849.

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

* Extensions: improve formatting

No functional changes.

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

* Native: set maximum constraint for MaxValidUntilBlockIncrement

It's set to be a day of 1-second blocks, that should be enough, ref.
neo-project#3861 (comment).

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

---------

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
Co-authored-by: Shargon <shargon@gmail.com>
Co-authored-by: Will <201105916+Wi1l-B0t@users.noreply.github.com>
Co-authored-by: Christopher Schuchardt <cschuchardt88@gmail.com>
Co-authored-by: Jimmy <jinghui@wayne.edu>
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.

2 participants