Commit graph

9 commits

Author SHA1 Message Date
HAOYUatHZ
8616fc2522
sync GPO changes (#954)
* feat: congestion-aware gas price oracle (#790)

* Implement functionality to reset gas price / suggested tip to minimal value when there's no congestion

* Add flags to configure congestion value and initialize gas price oracle accordingly

* Fix and add tests to make sure GPO works as expected depending on pre- or post-Curie (EIP 1559) upgrade

* Apply review suggestions

* chore: auto version bump [bot]

---------

Co-authored-by: omerfirmak <omerfirmak@users.noreply.github.com>

* fix eth/gasprice/gasprice_test.go

* minor

* fix(GPO): min suggested tip cap if there's congestion to avoid filtering through `DefaultIgnorePrice` (#883)

* fix tests

* fix tests

---------

Co-authored-by: Jonas Theis <4181434+jonastheis@users.noreply.github.com>
Co-authored-by: omerfirmak <omerfirmak@users.noreply.github.com>
2024-08-01 21:41:51 +08:00
HAOYUatHZ
17acae881a
defer txpool reorg until worker fetches txns for the next block (#944)
* feat: defer txpool reorg until worker fetches txns for the next block (#905)

* fix

---------

Co-authored-by: Ömer Faruk Irmak <omerfirmak@gmail.com>
2024-08-01 14:19:44 +08:00
HAOYUatHZ
ac044caa1b
feat(miner): account fetch limit (#939)
* feat(worker): try to limit the number of txns miner has to deal with (#745)

to reduce the effect of having a huge backlog on performance

* fix(worker): set default account fetch limit (#756)

* fix

* update miner/worker.go

* fix

---------

Co-authored-by: Ömer Faruk Irmak <omerfirmak@gmail.com>
Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
2024-07-29 19:07:43 +08:00
HAOYUatHZ
c293daa83c
replace package name (#924)
* replace package name

* clean up
2024-07-25 08:26:20 +08:00
HAOYUatHZ
ca1ba1da87
feat: add ccc into miner (#674)
* add core/rawdb/accessors_row_consumption.go

* update core/rawdb/schema.go

* update eth/ethconfig/config.go

* update eth/ethconfig/gen_config.go

* update miner/miner.go

* update eth/backend.go

* update core/types.go

* update cmd/geth/main.go

* update cmd/utils/flags.go

* update core/types/block.go

* update core/block_validator.go

* WIP: update miner/worker.go

* WIP: update miner/worker.go

* WIP: update miner/worker.go

* WIP: update miner/worker.go

* WIP: update miner/worker.go

* WIP: update miner/worker.go add withTimer

* WIP: update miner/worker.go

* WIP: update miner/worker.go add some func

* WIP: update miner/worker.go `makeEnv`

* fix

* fix

* minor

* init traces return

* init accRows

* update `applyTransaction`

* fix `TestPriorityClient`

* miner: update metrics

* minor

* add `l2CommitTxTraceStateRevertTimer`

* update `calcAndSetAccRowsForEnv`

* start to work on `commitTransactions`

* seal block early if we're over time

* If we have collected enough transactions then we're done

* check L1 message queue index

* A single L1 message leads to out-of-gas

* more on nil err

* more error

* skip RemoveTx for now

* minor

* l1TxStrangeErr

* fix interface

* start to work on `commitWork`

* minor

* draft `fillTransactions`

* fix some types

* refactor

* fix

* add `circuitCapacityReached`

* minor

* fix `txToLazyTx`

* fix `(m *mockBackend) ChainDb()`

* fix `removeTx`

* update comments
2024-04-28 18:16:10 +08:00
Péter Szilágyi
a8a9c8e4b0
core, eth, miner: start propagating and consuming blob txs (#28243)
* core, eth, miner: start propagating and consuming blob txs

* eth/protocols/eth: disable eth/67 if Cancun is enabled

* core/txpool, eth, miner: pass gas limit infos in lazy tx for mienr filtering

* core/txpool, miner: add lazy resolver for pending txs too

* core, eth: fix review noticed bugs

* eth, miner: minor polishes in the mining and announcing logs

* core/expool: unsubscribe the event scope
2023-10-04 12:36:36 +03:00
Felix Lange
2a6beb6a39
core/types: support for optional blob sidecar in BlobTx (#27841)
This PR removes the newly added txpool.Transaction wrapper type, and instead adds a way
of keeping the blob sidecar within types.Transaction. It's better this way because most
code in go-ethereum does not care about blob transactions, and probably never will. This
will start mattering especially on the client side of RPC, where all APIs are based on
types.Transaction. Users need to be able to use the same signing flows they already
have.

However, since blobs are only allowed in some places but not others, we will now need to
add checks to avoid creating invalid blocks. I'm still trying to figure out the best place
to do some of these. The way I have it currently is as follows:

- In block validation (import), txs are verified not to have a blob sidecar.
- In miner, we strip off the sidecar when committing the transaction into the block.
- In TxPool validation, txs must have a sidecar to be added into the blobpool.
  - Note there is a special case here: when transactions are re-added because of a chain
    reorg, we cannot use the transactions gathered from the old chain blocks as-is,
    because they will be missing their blobs. This was previously handled by storing the
    blobs into the 'blobpool limbo'. The code has now changed to store the full
    transaction in the limbo instead, but it might be confusing for code readers why we're
    not simply adding the types.Transaction we already have.

Code changes summary:

- txpool.Transaction removed and all uses replaced by types.Transaction again
- blobpool now stores types.Transaction instead of defining its own blobTx format for storage
- the blobpool limbo now stores types.Transaction instead of storing only the blobs
- checks to validate the presence/absence of the blob sidecar added in certain critical places
2023-08-14 10:13:34 +02:00
Péter Szilágyi
1662228ac6
core/txpool/blobpool: 4844 blob transaction pool (#26940)
* core/blobpool: implement txpool for blob txs

* core/txpool: track address reservations to notice any weird bugs

* core/txpool/blobpool: add support for in-memory operation for tests

* core/txpool/blobpool: fix heap updating after SetGasTip if account is evicted

* core/txpool/blobpool: fix eviction order if cheap leading txs are included

* core/txpool/blobpool: add note as to why the eviction fields are not inited in reinject

* go.mod: pull in inmem billy form upstream

* core/txpool/blobpool: fix review commens

* core/txpool/blobpool: make heap and heap test deterministic

* core/txpool/blobpool: luv u linter

* core/txpool: limit blob transactions to 16 per account

* core/txpool/blobpool: fix rebase errors

* core/txpool/blobpool: luv you linter

* go.mod: revert some strange crypto package dep updates
2023-07-27 13:45:35 +03:00
Péter Szilágyi
d40a255e97
all: move main transaction pool into a subpool (#27463)
* all: move main transaction pool into a subpool

* go.mod: remove superfluous updates

* core/txpool: review fixes, handle txs rejected by all subpools

* core/txpool: typos
2023-06-16 15:29:40 +03:00