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

[R4R] make prune tool available #186

Merged
merged 3 commits into from
May 6, 2021
Merged

[R4R] make prune tool available #186

merged 3 commits into from
May 6, 2021

Conversation

unclezoro
Copy link
Collaborator

@unclezoro unclezoro commented May 6, 2021

Description

The pruning tool is broken, and add layer 1 as the scope of the prune target.

Rationale

Fix the prune tool

Example

add an example CLI or API response...

Changes

Notable changes:

  • add each change in a bullet point here
  • ...

Preflight checks

  • build passed (make build)
  • tests passed (make test)
  • manual transaction test passed

Already reviewed by

...

Related issues

... reference related issue #'s here ...

@unclezoro unclezoro changed the title Upgrade tmp [R4R] make prune tool available May 6, 2021
@unclezoro unclezoro changed the base branch from upgrade_1.10.2 to upgrade_1.10.3 May 6, 2021 03:50
@unclezoro unclezoro changed the base branch from upgrade_1.10.3 to upgrade_1.10.2 May 6, 2021 03:57
@unclezoro unclezoro merged commit 0316072 into upgrade_1.10.2 May 6, 2021
galaio pushed a commit to galaio/bsc that referenced this pull request Jul 31, 2024
…oad) (bnb-chain#186)

* miner: Add block building interruption on payload resolution (getPayload)

* miner: Change full payload resolution, fix and add test

* miner: Add parameter validation if skipping empty block

We only build the empty block if we don't use the tx pool.
So if we use the tx pool, a forkchoiceUpdated call would miss
the implicit validation that's happening during empty block building,
so we need to add it back.

* miner: Always wait for block builder result after interrupting

This commit changes the way the block builder/update routine and the
resolution functions Resolve and ResolveFull synchronize.
Resolve(Full) now signal the payload builder to pause and set the
interrupt signal in case any block building is ongoing. They then
wait for the interrupted block building to complete.

This allowed to simplify the Payload implementation somewhat because the
builder routine is now guaranteed to return before the resulting fields
(full, fullFees etc) are read, and closing of the `stop` channel is now
synchronized with a sync.Once. So the mutex and conditional variable
could be removed and we only use two simple signalling channels
`stop` and `done` for synchronization.

* miner: Add testing mode to module

Some test in the miner and catalyst package assume that getPayload
can be immediately called after forkchoiceUpdated and then to return
some built block. Because of the new behavior of payload resolution to
interrupt any ongoing payload building process, this creates a race
condition on block building.

The new testing mode, which can be enabled by setting the package variable
IsPayloadBuildingTest to true, guarantees that always at least one
full block is built.

It's hacky, but seems to be the easiest and less-intrusive way to enable
the new behavior of payload resolution while still keeping all tests
happy.

* miner: Further improve block building interruption

- Priotize stop signal over recommit
- Don't start payload building update if last update duration
  doesn't fit until slot timeout.

* miner: Partially revert rework of payload build stopping

When resolving, we don't want to wait for the latest update.
If a full block is available, we just return that one, as before.
Payload building is still interrupted, but exits in the background.

* miner: Return early when building interrupted payload updates

* Remove global variable to change miner behaviour.
Use a longer wait in tests for the payload to build.

* miner: Interrupt first payload building job

Also added interrupt test.
Had to add sleep to make non-interrupt test work.

* eth/catalyst: Add even more sleeps to make tests get over payload interruption

* Deterministically wait for payloads to build the first full block

* eth/catalyst,miner: Improve payload full block waiting in tests

Also fix a bug in TestNilWithdrawals where the withdrawals weren't added
to the ephemeral BuildPayloadArgs instance for re-calculating the
payload id.

* miner: Calculate sane block building time in validateParams

Also always stop interrupt timer after fillTransactions in generateWork.

---------

Co-authored-by: Adrian Sutton <adrian@oplabs.co>
galaio pushed a commit to galaio/bsc that referenced this pull request Jul 31, 2024
…oad) (bnb-chain#186)

* miner: Add block building interruption on payload resolution (getPayload)

* miner: Change full payload resolution, fix and add test

* miner: Add parameter validation if skipping empty block

We only build the empty block if we don't use the tx pool.
So if we use the tx pool, a forkchoiceUpdated call would miss
the implicit validation that's happening during empty block building,
so we need to add it back.

* miner: Always wait for block builder result after interrupting

This commit changes the way the block builder/update routine and the
resolution functions Resolve and ResolveFull synchronize.
Resolve(Full) now signal the payload builder to pause and set the
interrupt signal in case any block building is ongoing. They then
wait for the interrupted block building to complete.

This allowed to simplify the Payload implementation somewhat because the
builder routine is now guaranteed to return before the resulting fields
(full, fullFees etc) are read, and closing of the `stop` channel is now
synchronized with a sync.Once. So the mutex and conditional variable
could be removed and we only use two simple signalling channels
`stop` and `done` for synchronization.

* miner: Add testing mode to module

Some test in the miner and catalyst package assume that getPayload
can be immediately called after forkchoiceUpdated and then to return
some built block. Because of the new behavior of payload resolution to
interrupt any ongoing payload building process, this creates a race
condition on block building.

The new testing mode, which can be enabled by setting the package variable
IsPayloadBuildingTest to true, guarantees that always at least one
full block is built.

It's hacky, but seems to be the easiest and less-intrusive way to enable
the new behavior of payload resolution while still keeping all tests
happy.

* miner: Further improve block building interruption

- Priotize stop signal over recommit
- Don't start payload building update if last update duration
  doesn't fit until slot timeout.

* miner: Partially revert rework of payload build stopping

When resolving, we don't want to wait for the latest update.
If a full block is available, we just return that one, as before.
Payload building is still interrupted, but exits in the background.

* miner: Return early when building interrupted payload updates

* Remove global variable to change miner behaviour.
Use a longer wait in tests for the payload to build.

* miner: Interrupt first payload building job

Also added interrupt test.
Had to add sleep to make non-interrupt test work.

* eth/catalyst: Add even more sleeps to make tests get over payload interruption

* Deterministically wait for payloads to build the first full block

* eth/catalyst,miner: Improve payload full block waiting in tests

Also fix a bug in TestNilWithdrawals where the withdrawals weren't added
to the ephemeral BuildPayloadArgs instance for re-calculating the
payload id.

* miner: Calculate sane block building time in validateParams

Also always stop interrupt timer after fillTransactions in generateWork.

---------

Co-authored-by: Adrian Sutton <adrian@oplabs.co>
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.

2 participants