Skip to content

Commit 2db84ed

Browse files
SuperFluffyitamarreifbharath-123quasystaty1
authoredFeb 14, 2025··
feat(auctioneer): add new service (#1839)
## Summary This patch adds the Astria Auctioneer service to the monorepo. ## Background The Astria Auctioneer auctions the top of the next Rollup to the highest bidder. It receives a proposed Sequencer block[^1] via a Sequencer node's `astria.sequencerblock.optimistic.v1alpha1.OptimisticBlock` service, and forwards it to its Rollup node's `astria.auction.v1alpha1.OptimisticExecutionService` for optimistic execution by the Rollup. The executed optimistic block hash returned by the rollup triggers Auctioneer to start an auction. It then receives bids from the Rollup node's `astria.auction.v1alpha.AuctionService`, selecting the winner using a first-price mechanism. The auction winner is finally submitted to the same Sequencer node using a standard ABCI `broadcast_tx_sync` to the Sequencer network. Auctioneer does not act as a server in its own right but connects as a client to a Rollup node and to a Sequencer node. [^1]: A proposed Sequencer block is that data structure that comes out of the Astria Sequencer network's CometBFT process-proposal step. ## Changes - Add crate `crates/astria-auctioneer`. It is implemented as a simple event loop that multiplexes proposed blocks and finalized commits (from sequencer), as well as executed rollup blocks and bids (from the rollup). - Bump workspace dependency `tokio_utils` to `0.7.13` to get access to `CancellationToken::run_until_cancelled` - Rename execution APIs `astria.bundle` to `astria.auction` - Add domain type `SequencerBlockCommit` to new `astria_core::sequencerblock::optimistic::v1alpha1` submodule, following protobuf spec naming conventions (the other domain types remain exclusive to auctioneer for now). - Implement `astria_core::Protobuf` for `FilteredSequencerBlock` to get access to the wiretype name in error and log messages. - Refactor `astria_sequencer::sequencer::start_grpc_server` to `astria-sequencer::grpc::serve` - Add module `astria_sequencer::grpc::optimistic` implementing the `astria.sequencerblock.optimistic.v1alpha1.OptimisticBlock` gRPC service - Refactor `astria_sequencer::app` module to implement an `EventBus` that is used by the gRPC service to subscribe to new events (right now, only proposed blocks and commits). - Add setting `ASTRIA_SEQUENCER_NO_OPTIMISTIC_BLOCKS` to toggle the optimistic block service in Sequencer - Add chart `charts/auctioneer` - Update `charts/evm-rollup/files/genesis/geth-genesis.json` to set `astriaAuctioneerAddresses` - Update `charts/sequencer/templates/configmaps.yaml` to to set `ASTRIA_SEQUENCER_NO_OPTIMISTIC_BLOCKS` - Update `justifle` to understand how to docker-build auctioneer - Add job `auctioneer` to docker-build github workflow. ## Testing This patch does not contain blackbox tests because there currently is no support in the Rust ecosystem to easily mock streams. Smoke tests to submit a winning bid to sequencer and have it executed against geth will be done in a follow-up PR. We deployed a local setup consisting of a dedicated auctioneer flame node, the auctioneer node and a sequencer with optimistic blocks enabled. The code for auctioneer flame node can be found at astriaorg/flame#30. The auctioneer has been tested locally against this auctioneer flame node branch. We have tested the setup by sending txs to the auctioneer flame node using spamooor. We check with logs and manually query the blocks to ensure that the tx sent has end up on the top of block of the auctioneer. ## Metrics - `astria_auctioneer_block_commitments_received`: counter (the number of block commitments auctioneer received from sequencer over its runtime) - `astria_auctioneer_executed_blocks_received`: counter (the number of executed blocks auctioneer received from its connected rollup over its runtime) - `astria_auctioneer_proposed_blocks_received`: counter (the number of proposed blocks auctioneer received from sequencer over its runtime) - `astria_auctioneer_auctions_cancelled`: counter (the auctions auctioneer cancelled over its runtime because a new proposed sequencer block cancelled a previous one and thus the auction; this might include auctions for which sumissions took too long) - `astria_auctioneer_auctions_submitted`: counter (the auctions auctioneer successfully submitted over its runtime) - `astria_auctioneer_auction_bids_received`: counter (total bids received over the runtime of auctioneer) - `astria_auctioneer_auction_bids: histogram` (bids per auction labels "processed" and "dropped") - `astria_auctioneer_auction_bids_without_matching_auction`: counter (the number of bids auctioneer received without having a matching auction running over its runtime; for example because the bid contained a difference sequencer or rollup block hashes than what the auction expected) - `astria_auctioneer_winner_submission_latency` histogram (labels "success" and "error"; time from when an auction started and auctioneer received a bid for the auction) - `astria_winning_bid`: histogram (the amount that the winning bid was willing to pay) ## Changelogs Changelogs updated. ## Related Issues closes #1888 closes #1533 closes #1820 --------- Co-authored-by: itamar <[email protected]> Co-authored-by: Bharath <[email protected]> Co-authored-by: quasystaty <[email protected]>
1 parent a4a41ec commit 2db84ed

File tree

94 files changed

+7434
-1612
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+7434
-1612
lines changed
 

‎.github/workflows/docker-build.yml

+18-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
required: false
1313
type: choice
1414
options:
15+
- auctioneer
1516
- composer
1617
- conductor
1718
- sequencer
@@ -39,6 +40,22 @@ jobs:
3940
run_checker:
4041
uses: ./.github/workflows/reusable-run-checker.yml
4142

43+
auctioneer:
44+
needs: run_checker
45+
if: needs.run_checker.outputs.run_docker == 'true' || (github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'auctioneer')
46+
uses: "./.github/workflows/reusable-docker-build.yml"
47+
permissions:
48+
contents: read
49+
id-token: write
50+
packages: write
51+
with:
52+
depot-project-id: 1kp2p2bvbr
53+
package-name: auctioneer
54+
binary-name: auctioneer
55+
tag: ${{ inputs.tag }}
56+
force: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'auctioneer' }}
57+
secrets: inherit
58+
4259
composer:
4360
needs: run_checker
4461
if: needs.run_checker.outputs.run_docker == 'true' || (github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'composer')
@@ -296,7 +313,7 @@ jobs:
296313
297314
docker:
298315
if: ${{ always() && !cancelled() }}
299-
needs: [composer, conductor, sequencer, sequencer-relayer, evm-bridge-withdrawer, cli, smoke-test, smoke-cli, ibc-bridge-test, ibc-no-native-asset-test, ibc-timeout-refund]
316+
needs: [auctioneer, composer, conductor, sequencer, sequencer-relayer, evm-bridge-withdrawer, cli, smoke-test, smoke-cli, ibc-bridge-test, ibc-no-native-asset-test, ibc-timeout-refund]
300317
uses: ./.github/workflows/reusable-success.yml
301318
with:
302319
success: ${{ !contains(needs.*.result, 'failure') }}

‎CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
* @joroshiba
22

3+
astria-auctioneer/ @SuperFluffy @bharath-123
34
astria-bridge-contracts/ @SuperFluffy @joroshiba
45
astria-bridge-withdrawer/ @SuperFluffy @joroshiba
56
astria-build-info/ @SuperFluffy @joroshiba

0 commit comments

Comments
 (0)
Please sign in to comment.