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

Allow specifying stepDuration as a map. #152

Merged
merged 3 commits into from
Jun 24, 2019

Conversation

afck
Copy link
Collaborator

@afck afck commented Jun 20, 2019

Closes #122, #124, #150.

vkomenda and others added 2 commits June 20, 2019 10:51
added a map variant to the stepDuration config parameter

handling the initial step duration from the config map

introduced the next step duration

fixed step duration tests

panic if step duration is 0

added panics on step duration 0

corrected the panic string

moved step duration update to on_prepare_block

corrected the use of the signer address

moved the step duration update to on_close_block

changed the step duration during the step increment

added next_duration to tests

calibrate the step timeout after duration update

changing step duration seems to work

updated tests

estimating the start of a same step duration interval from time and the number of steps

step durations derived from step numbers

set the initial step to 0

review comments
@afck afck requested review from vkomenda and varasev June 20, 2019 09:24
@afck afck marked this pull request as ready for review June 20, 2019 09:24
Copy link

@vkomenda vkomenda left a comment

Choose a reason for hiding this comment

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

Looks good to me.

panic!("authority_round: step duration can't be zero")
if !our_params.step_durations.contains_key(&0) {
error!(target: "engine", "Authority Round step 0 duration is undefined, aborting");
panic!("authority_round: step 0 duration is undefined")

Choose a reason for hiding this comment

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

"step 0" -> "timestamp 0"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure; timestamp 0 is always also step 0, so this is the duration of step 0.

ethcore/src/engines/authority_round/mod.rs Outdated Show resolved Hide resolved
@varasev
Copy link

varasev commented Jun 20, 2019

Should the timestamps be calculated in UTC or in the local time zone?

@afck afck force-pushed the afck-step-duration-transition-rebased branch from f8f946f to b8ef2a4 Compare June 21, 2019 07:26
@afck
Copy link
Collaborator Author

afck commented Jun 21, 2019

UTC. The timestamps are in Unix time.

Copy link

@varasev varasev left a comment

Choose a reason for hiding this comment

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

I wasn't able to run unit tests for the afck-step-duration-transition-rebased branch.

My rustc version is 1.34.0-nightly (d8a0dd7ae 2019-01-28).

When I try to perform cd ethcore && cargo test, I see the following errors:

image

image

///
/// Deliberately typed as u16 as too high of a value leads
/// to slow block issuance.
pub step_duration: u16,
Copy link

Choose a reason for hiding this comment

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

We need to keep the step_duration parameter as well for backward compatibility.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That should still be accepted: It can now either be a number, like before, or a map.

Copy link

Choose a reason for hiding this comment

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

Ah, I see, OK.

@varasev
Copy link

varasev commented Jun 24, 2019

If I remove the redundant current_duration, starting_sec, starting_step fields from the Step structure, the unit tests test_counter_increment_too_high and test_counter_duration_remaining_too_high in ethcore/src/engines/authority_round/mod.rs are fine.

@afck afck force-pushed the afck-step-duration-transition-rebased branch from b8ef2a4 to 5effbc7 Compare June 24, 2019 07:17
@afck
Copy link
Collaborator Author

afck commented Jun 24, 2019

Sorry! I updated the unit tests.

Copy link

@varasev varasev left a comment

Choose a reason for hiding this comment

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

Let's merge it 👍

@varasev varasev merged commit 7f08dd8 into aura-pos Jun 24, 2019
@afck afck deleted the afck-step-duration-transition-rebased branch June 24, 2019 17:20
@vkomenda vkomenda restored the afck-step-duration-transition-rebased branch July 10, 2019 20:22
@afck afck deleted the afck-step-duration-transition-rebased branch January 8, 2020 10:25
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.

Changing the value of stepDuration option in spec.json for AuRa
3 participants