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

Don't stake for previously staked times #1083

Merged
merged 9 commits into from
Aug 4, 2023
Merged

Conversation

alfiedotwtf
Copy link
Contributor

See #1005 for more details.

Copy link
Collaborator

@TheQuantumPhysicist TheQuantumPhysicist left a comment

Choose a reason for hiding this comment

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

It's not perfect because it doesn't take into account different consensus algorithms, but I can live with this now.

However, please postpone merging this to after the release. I want this properly tested before it goes to the testnet.

Copy link
Contributor

@iljakuklic iljakuklic 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. Some minor coding suggestions below.

blockprod/src/detail/tests.rs Outdated Show resolved Hide resolved
blockprod/src/detail/tests.rs Outdated Show resolved Hide resolved
blockprod/src/detail/job_manager/mod.rs Show resolved Hide resolved
pub fn generate_custom_id(&self, input_data: &GenerateBlockInputData) -> CustomId {
match input_data {
GenerateBlockInputData::PoS(pos_input_data) => {
pos_input_data.stake_public_key().encode()
Copy link
Member

Choose a reason for hiding this comment

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

not sure how important that is but it's confusing that PoS returns the same value every time. Given that struct is called "generate" and for PoW it actually generates random value. Is it intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah. So the function "generates" for PoW, but for PoS the value is fixed. The struct has a "Generate" prefix because it's the struct for the "generate_block()" RPC call.

Copy link
Collaborator

@TheQuantumPhysicist TheQuantumPhysicist left a comment

Choose a reason for hiding this comment

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

I'm approving, but please wait for others to provide a second optinion after my changes.

blockprod/src/detail/mod.rs Outdated Show resolved Hide resolved
@alfiedotwtf alfiedotwtf merged commit 0a23faa into master Aug 4, 2023
23 checks passed
@alfiedotwtf alfiedotwtf deleted the alfie/skip-timestamps branch August 4, 2023 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.

None yet

5 participants