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

Make generated block proposals cancel each other out #3249

Merged

Conversation

ndr-ds
Copy link
Contributor

@ndr-ds ndr-ds commented Feb 4, 2025

Motivation

The block proposals are supposed to rotate and cancel each other out, but there's currently a bug in how we do it.

Proposal

Fix the bug

Test Plan

CI + ran locally

Release Plan

  • Nothing to do / These changes follow the usual release cycle.

@ma2bd
Copy link
Contributor

ma2bd commented Feb 4, 2025

@ndr-ds It's already a rotation

@ndr-ds ndr-ds requested review from afck, christos-h, jvff, ma2bd and Twey February 5, 2025 00:51
Copy link
Contributor Author

ndr-ds commented Feb 5, 2025

Ah, I guess it is, but there's a bug. The bug made me think this wasn't actually supposed to rotate. I'll just fix the bug in this PR then.

@ndr-ds ndr-ds force-pushed the 02-04-make_generated_block_proposals_cancel_each_other_out branch from 29ae5ec to 1822992 Compare February 5, 2025 01:01
@@ -959,7 +959,11 @@ where
fungible_application_id: Option<ApplicationId>,
) -> Vec<RpcMessage> {
let mut proposals = Vec::new();
let mut next_recipient = self.wallet.last_chain().unwrap().chain_id;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you run it with 100 chains, then after that you run with 10 chains, your wallet will actually still have 100 chains, but you're only gonna use the first 10. So in this case, the last chain in the wallet won't actually match the last chain in the key_pairs. But for this to properly rotate and cancel each other out, it needs to always match the last chain in key_pairs.

Copy link
Contributor

Choose a reason for hiding this comment

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

Right, good catch!

@@ -959,7 +959,11 @@ where
fungible_application_id: Option<ApplicationId>,
) -> Vec<RpcMessage> {
let mut proposals = Vec::new();
let mut next_recipient = self.wallet.last_chain().unwrap().chain_id;
Copy link
Contributor

Choose a reason for hiding this comment

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

Right, good catch!

@ndr-ds ndr-ds force-pushed the 02-03-parallelize_staging_block_execution branch from 8bfe558 to b48ea1f Compare February 5, 2025 20:09
@ndr-ds ndr-ds force-pushed the 02-04-make_generated_block_proposals_cancel_each_other_out branch from 1822992 to 3467d73 Compare February 5, 2025 20:09
@ndr-ds ndr-ds force-pushed the 02-03-parallelize_staging_block_execution branch from b48ea1f to 33bf983 Compare February 5, 2025 23:58
@ndr-ds ndr-ds force-pushed the 02-04-make_generated_block_proposals_cancel_each_other_out branch from 3467d73 to 2fba85e Compare February 5, 2025 23:58
@ndr-ds ndr-ds force-pushed the 02-03-parallelize_staging_block_execution branch from 33bf983 to a480e16 Compare February 6, 2025 00:05
@ndr-ds ndr-ds force-pushed the 02-04-make_generated_block_proposals_cancel_each_other_out branch from 2fba85e to 83f3775 Compare February 6, 2025 00:05
@ndr-ds ndr-ds force-pushed the 02-03-parallelize_staging_block_execution branch from a480e16 to eed7006 Compare February 6, 2025 03:47
@ndr-ds ndr-ds force-pushed the 02-04-make_generated_block_proposals_cancel_each_other_out branch from 83f3775 to 646f774 Compare February 6, 2025 03:47
@burakacar7

This comment was marked as spam.

@ndr-ds ndr-ds force-pushed the 02-03-parallelize_staging_block_execution branch from eed7006 to 98d8d58 Compare February 6, 2025 13:37
@ndr-ds ndr-ds force-pushed the 02-04-make_generated_block_proposals_cancel_each_other_out branch from 646f774 to 66caa6a Compare February 6, 2025 13:37
@ndr-ds ndr-ds force-pushed the 02-03-parallelize_staging_block_execution branch from 98d8d58 to add6a9c Compare February 6, 2025 14:12
@ndr-ds ndr-ds force-pushed the 02-04-make_generated_block_proposals_cancel_each_other_out branch 2 times, most recently from 7936bf0 to 8d32a72 Compare February 6, 2025 17:31
@ndr-ds ndr-ds changed the base branch from 02-03-parallelize_staging_block_execution to 02-03-parallelize_supply_fungible_tokens February 6, 2025 17:31
@ndr-ds ndr-ds force-pushed the 02-03-parallelize_supply_fungible_tokens branch from 90c2c62 to 8bdcfb6 Compare February 6, 2025 17:42
@ndr-ds ndr-ds force-pushed the 02-04-make_generated_block_proposals_cancel_each_other_out branch from 8d32a72 to 9d2a160 Compare February 6, 2025 17:42
Copy link
Contributor Author

ndr-ds commented Feb 6, 2025

Merge activity

  • Feb 6, 1:28 PM EST: A user started a stack merge that includes this pull request via Graphite.
  • Feb 6, 1:37 PM EST: Graphite rebased this pull request as part of a merge.
  • Feb 6, 1:39 PM EST: A user merged this pull request with Graphite.

@ndr-ds ndr-ds changed the base branch from 02-03-parallelize_supply_fungible_tokens to graphite-base/3249 February 6, 2025 18:34
@ndr-ds ndr-ds changed the base branch from graphite-base/3249 to main February 6, 2025 18:36
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.

4 participants