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

Block production trigger #599

Merged
merged 13 commits into from
Oct 13, 2022
Merged

Block production trigger #599

merged 13 commits into from
Oct 13, 2022

Conversation

Dentosal
Copy link
Member

@Dentosal Dentosal commented Sep 9, 2022

Closes #50

Requires #409 to be merged first

@Dentosal Dentosal self-assigned this Sep 9, 2022
@Dentosal Dentosal force-pushed the block-production-trigger branch from b42d341 to d220375 Compare September 9, 2022 12:43
@Voxelot Voxelot changed the base branch from master to Voxelot/block-producer-init September 9, 2022 19:58
@Voxelot
Copy link
Member

Voxelot commented Sep 9, 2022

FYI:

I retargeted this PR to diff against #409

As far as configuration is concerned, we'll want a way to connect/consolidate with the ProductionStrategy ChainConfig enum: https://github.com/FuelLabs/fuel-core/blob/v0.10.1/fuel-core/src/chain_config.rs#L107

@Dentosal Dentosal force-pushed the block-production-trigger branch 2 times, most recently from 630fabf to 751737d Compare September 20, 2022 21:23
Base automatically changed from Voxelot/block-producer-init to master September 24, 2022 00:45
@Dentosal Dentosal changed the title Block production trigger WIP Block production trigger Sep 30, 2022
@Dentosal Dentosal marked this pull request as ready for review September 30, 2022 11:58
@Dentosal
Copy link
Member Author

Ready for the initial round of comments

@Dentosal Dentosal requested a review from a team September 30, 2022 17:56
@bvrooman
Copy link
Contributor

Can we upgrade tokio in a separate PR to reduce some of the noise? It would remove a handful of files from your PR.

fuel-core/src/service/modules.rs Outdated Show resolved Hide resolved
fuel-core/src/service/modules.rs Outdated Show resolved Hide resolved
fuel-poa-coordinator/src/service.rs Outdated Show resolved Hide resolved
fuel-poa-coordinator/src/service.rs Outdated Show resolved Hide resolved
fuel-block-producer/src/config.rs Show resolved Hide resolved
fuel-core/src/service/config.rs Outdated Show resolved Hide resolved
fuel-core/src/service/modules.rs Outdated Show resolved Hide resolved
fuel-core/src/service/modules.rs Show resolved Hide resolved
@Dentosal
Copy link
Member Author

Dentosal commented Sep 30, 2022

See #662 for tokio upgrade to simplify this one

@Dentosal Dentosal requested a review from bvrooman October 3, 2022 14:48
@Voxelot Voxelot mentioned this pull request Oct 3, 2022
@Voxelot
Copy link
Member

Voxelot commented Oct 4, 2022

Looks like we'll need a separate PR for enabling the real block producer in fuel-core and disabling the executor.submit_txs flow so that this poa coordinator is used instead.

@Voxelot
Copy link
Member

Voxelot commented Oct 4, 2022

Also, have you tried running fuel-core via CLI to see what happens when txs are submitted? I'm not seeing any options on the CLI to configure the block production settings.

@Dentosal
Copy link
Member Author

Dentosal commented Oct 5, 2022

I've added the production settings to ChainConfig. I'm not sure if they should instead be command line parameters for fuel-core instead, but chain config seems potentially better place to keep this.

@Dentosal Dentosal force-pushed the block-production-trigger branch from 52212a2 to fbdd88b Compare October 5, 2022 05:04
@Voxelot
Copy link
Member

Voxelot commented Oct 5, 2022

ChainConfig does make sense. The reason I was thinking of having CLI options to select the mode is for development or debugging. It's a fairly common practice in Ethereum to fork the mainnet chain and then put it into instant mode for local testing.

Given it's not that hard to edit the chainconfig json, I don't mind leaving the settings there for now. If we wanted to support CLI overrides in the future, we could use the chainconfig as a way to store the default settings and metadata needed for initializing a PoS network for example, but if the option to use instant mode is provided via CLI then chainconfig could be ignored.

@Voxelot
Copy link
Member

Voxelot commented Oct 12, 2022

clippy is failing

@Dentosal Dentosal force-pushed the block-production-trigger branch from 9626da5 to 1d01b1a Compare October 12, 2022 14:41
Dentosal and others added 4 commits October 13, 2022 08:39
Co-authored-by: Brandon Kite <brandonkite92@gmail.com>
Co-authored-by: Brandon Kite <brandonkite92@gmail.com>
Co-authored-by: Brandon Kite <brandonkite92@gmail.com>
@Dentosal Dentosal requested a review from Voxelot October 13, 2022 05:45
Voxelot
Voxelot previously approved these changes Oct 13, 2022
Copy link
Member

@Voxelot Voxelot left a comment

Choose a reason for hiding this comment

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

very cool use of tokio time!

the hybrid trigger is the most complicated piece here and also has the least amount of tests. But we can cover this more extensively during the integration with fuel-core.

The only thing that may need to change based on the current arch discussion is that notifying the txpool about the new block should probably be done in the block importer. But since the importer doesn't exist yet, we can defer that.

Co-authored-by: Brandon Kite <brandonkite92@gmail.com>
@Dentosal Dentosal enabled auto-merge (squash) October 13, 2022 06:48
@Dentosal Dentosal requested a review from freesig October 13, 2022 07:58
@Dentosal Dentosal dismissed freesig’s stale review October 13, 2022 13:28

This was already resolved, deferring to a new issue

@Dentosal Dentosal merged commit efa498c into master Oct 13, 2022
@Dentosal Dentosal deleted the block-production-trigger branch October 13, 2022 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configurable Block Production Trigger
5 participants