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

Controlc/block api #461

Merged
merged 15 commits into from
Jul 8, 2022
Merged

Controlc/block api #461

merged 15 commits into from
Jul 8, 2022

Conversation

ControlCplusControlV
Copy link
Contributor

@ControlCplusControlV ControlCplusControlV commented Jul 5, 2022

This PR adds a simple advance_block endpoint, which takes in an option of the amount to advance forward the block-height by (defaulting to 1 if nothing is supplied). I then inserts n empty FuelBlocks, and returns the new block-height. I was hoping to confirm this was inline with what you were looking for @vnepveu ?

Closes #455

@ControlCplusControlV ControlCplusControlV added the enhancement New feature or request label Jul 5, 2022
@ControlCplusControlV ControlCplusControlV self-assigned this Jul 5, 2022
@Voxelot
Copy link
Member

Voxelot commented Jul 6, 2022

We should have a config option for the node to disable this behavior in production. Otherwise strange things could happen.

@ControlCplusControlV
Copy link
Contributor Author

We should have a config option for the node to disable this behavior in production. Otherwise strange things could happen.

Oh true, wasn't sure how exactly best to do this. Should this endpoint be specifically addressed (ie config option like enable rpc-block-advance) or under a more general dev/testnet setting?

@ControlCplusControlV
Copy link
Contributor Author

@Voxelot I've updated this to require a config option to enabled (which is disabled by default) for this endpoint to work, and added a negative test to ensure it's off by default

Copy link
Contributor

@iqdecay iqdecay left a comment

Choose a reason for hiding this comment

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

vgud! ty for being so quick! Just some questions about naming :)

fuel-client/assets/schema.sdl Outdated Show resolved Hide resolved
fuel-client/src/client.rs Outdated Show resolved Hide resolved
fuel-core/src/schema/block.rs Outdated Show resolved Hide resolved
fuel-core/src/schema/block.rs Outdated Show resolved Hide resolved
fuel-tests/tests/blocks.rs Outdated Show resolved Hide resolved
ControlCplusControlV and others added 3 commits July 6, 2022 10:44
Co-authored-by: vicnep <nepveu.victor@hotmail.fr>
fuel-core/src/args.rs Outdated Show resolved Hide resolved
iqdecay
iqdecay previously requested changes Jul 7, 2022
Copy link
Contributor

@iqdecay iqdecay left a comment

Choose a reason for hiding this comment

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

One nit left, otherwise LGTM :)

fuel-core/src/args.rs Outdated Show resolved Hide resolved
@ControlCplusControlV ControlCplusControlV merged commit eaca506 into master Jul 8, 2022
@ControlCplusControlV ControlCplusControlV deleted the controlc/block_api branch July 8, 2022 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

feat: add API to mine block(s) without requiring signing a transaction
4 participants