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

Sync first epoch duration at application startup #708

Merged
merged 4 commits into from
Jul 22, 2021

Conversation

alexvanin
Copy link
Contributor

Closes #679

At the startup, Inner Ring application calculates block duration before next epoch tick and processes new epoch event at this block.

@codecov
Copy link

codecov bot commented Jul 21, 2021

Codecov Report

Merging #708 (a75fe73) into master (dfbde00) will increase coverage by 0.06%.
The diff coverage is 88.88%.

❗ Current head a75fe73 differs from pull request most recent head 6e0a141. Consider uploading reports for the commit 6e0a141 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #708      +/-   ##
==========================================
+ Coverage   44.30%   44.37%   +0.06%     
==========================================
  Files         211      211              
  Lines        9688     9700      +12     
==========================================
+ Hits         4292     4304      +12     
- Misses       5043     5044       +1     
+ Partials      353      352       -1     
Impacted Files Coverage Δ
pkg/morph/client/client.go 11.33% <0.00%> (-0.16%) ⬇️
pkg/morph/timer/block.go 97.26% <100.00%> (+3.60%) ⬆️

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 dfbde00...6e0a141. Read the comment docs.

@alexvanin
Copy link
Contributor Author

alexvanin commented Jul 21, 2021

To process single event in the future, I added NewOneTickTimer constructor in morph/timer (4ab91ae). Maybe there is a better solution for this.

Copy link
Member

@carpawell carpawell left a comment

Choose a reason for hiding this comment

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

it took some time for me to get the idea of what EpochBlock returns, i had to go to read it in contract code
wouldn't it be better to add smth like "last" or "start" or both to the method name?

@alexvanin
Copy link
Contributor Author

wouldn't it be better to add smth like "last" or "start" or both to the method name?

I thought about that. LastEpochBlock() in the contract and in the code will be better, what do you think?

@carpawell
Copy link
Member

what do you think?

yes, it sounds better for me

When Inner Ring node starts, it should sync nearest epoch tick
event based on the block of the latest epoch. Otherwise epoch
ticking can be stopped, because ballots or notary transactions
are valid for limited period of time.

Signed-off-by: Alex Vanin <[email protected]>
@alexvanin alexvanin merged commit 62efa3f into nspcc-dev:master Jul 22, 2021
carpawell pushed a commit that referenced this pull request Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
neofs-ir Inner Ring node application issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Internal timer syncronization
2 participants