Skip to content

Commit

Permalink
update config
Browse files Browse the repository at this point in the history
  • Loading branch information
itamarreif committed Oct 30, 2024
1 parent aceac2b commit 58b4ce8
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 56 deletions.
82 changes: 33 additions & 49 deletions crates/astria-auctioneer/local.env.example
Original file line number Diff line number Diff line change
@@ -1,10 +1,36 @@
# Configuration options of Astria AUCTIONEER.
# Configuration options of Astria Auctioneer.

# Log level. One of debug, info, warn, or error
ASTRIA_AUCTIONEER_LOG="astria_AUCTIONEER=info"
# Address of the gRPC server for the sequencer chain
ASTRIA_AUCTIONEER_SEQUENCER_GRPC_ENDPOINT="http://127.0.0.1:8080"

# If true disables writing to the opentelemetry OTLP endpoint.
ASTRIA_AUCTIONEER_NO_OTEL=false
# Address of the ABCI server for the sequencer chain
ASTRIA_AUCTIONEER_SEQUENCER_ABCI_ENDPOINT="http://127.0.0.1:26657"

# Chain ID of the sequencer chain which transactions are submitted to.
ASTRIA_AUCTIONEER_SEQUENCER_CHAIN_ID="astria-dev-1"

# The path to the file storing the private key for the sequencer account used for signing
# transactions. The file should contain a hex-encoded Ed25519 secret key.
ASTRIA_AUCTIONEER_SEQUENCER_PRIVATE_KEY_PATH=/path/to/priv_sequencer_key.json

# The fee asset denomination that will be used in the submitted sequencer transactions.
ASTRIA_AUCTIONEER_FEE_ASSET_DENOMINATION="nria"

# The prefix that will be used to construct bech32m sequencer addresses.
ASTRIA_AUCTIONEER_SEQUENCER_ADDRESS_PREFIX=astria

# Address of the gRPC server for the rollup's Optimistic Execution and Bundle services
ASTRIA_AUCTIONEER_ROLLUP_GRPC_ENDPOINT="http://127.0.0.1:50051"

# The rollup ID to post the auction result to
ASTRIA_AUCTIONEER_ROLLUP_ID="astriachain"

# The amount of time in miliseconds to wait between opening the auction and closing it to
# submit the result to the sequencer.
ASTRIA_AUCTIONEER_LATENCY_MARGIN_MS=1000

# Log level. One of debug, info, warn, or error
ASTRIA_AUCTIONEER_LOG="astria_auctioneer=info"

# If true disables tty detection and forces writing telemetry to stdout.
# If false span data is written to stdout only if it is connected to a tty.
Expand All @@ -21,56 +47,14 @@ ASTRIA_AUCTIONEER_PRETTY_PRINT=false
# is set to `true`.
NO_COLOR=

# Address of the API server
ASTRIA_AUCTIONEER_API_ADDR="0.0.0.0:0"

# Address of the RPC server for the sequencer chain
ASTRIA_AUCTIONEER_SEQUENCER_URL="http://127.0.0.1:26657"

# Chain ID of the sequencer chain which transactions are submitted to.
ASTRIA_AUCTIONEER_SEQUENCER_CHAIN_ID="astria-dev-1"

# A list of execution `<rollup_name_1>::<rpc_server_1>,<rollup_name_2>::<rpc_server_2>`.
# Rollup names are not case sensitive. If a name is repeated, the last list item is used.
# names are sha256 hashed and used as the `rollup_id` in `SequenceAction`s
ASTRIA_AUCTIONEER_ROLLUPS="astriachain::ws://127.0.0.1:8545"

# The path to the file storing the private key for the sequencer account used for signing
# transactions. The file should contain a hex-encoded Ed25519 secret key.
ASTRIA_AUCTIONEER_PRIVATE_KEY_FILE=/path/to/priv_sequencer_key.json

# The prefix that will be used to construct bech32m sequencer addresses.
ASTRIA_AUCTIONEER_SEQUENCER_ADDRESS_PREFIX=astria

# Block time in milliseconds, used to force submitting of finished bundles.
# Should match the sequencer node configuration for 'timeout_commit', as
# specified in https://docs.tendermint.com/v0.34/tendermint-core/configuration.html
ASTRIA_AUCTIONEER_MAX_SUBMIT_INTERVAL_MS=2000

# Max bytes to encode into a single sequencer `SignedTransaction`, not including signature,
# public key, nonce. This is the sum of the sizes of all the `SequenceAction`s. Should be
# set below the sequencer's max block size to allow space for encoding, signature, public
# key and nonce bytes
ASTRIA_AUCTIONEER_MAX_BYTES_PER_BUNDLE=200000

# Max amount of finished bundles that can be in the submission queue.
# ASTRIA_AUCTIONEER_BUNDLE_QUEUE_CAPACITY * ASTRIA_AUCTIONEER_MAX_BYTES_PER_BUNDLE (e.g.
# 40000 * 200KB=8GB) is the limit on how much memory the finished bundle queue can consume.
# This should be lower than the resource limit enforced by Kubernetes on the pod, defined here:
# https://github.com/astriaorg/astria/blob/622d4cb8695e4fbcd86456bd16149420b8acda79/charts/evm-rollup/values.yaml#L276
ASTRIA_AUCTIONEER_BUNDLE_QUEUE_CAPACITY=40000

# Set to true to enable prometheus metrics.
ASTRIA_AUCTIONEER_NO_METRICS=true

# The address at which the prometheus HTTP listener will bind if enabled.
ASTRIA_AUCTIONEER_METRICS_HTTP_LISTENER_ADDR="127.0.0.1:9000"

# The address at which the gRPC collector and health services are listening.
ASTRIA_AUCTIONEER_GRPC_ADDR="0.0.0.0:0"

# The asset to use for paying for transactions submitted to sequencer.
ASTRIA_AUCTIONEER_FEE_ASSET="nria"
# If true disables writing to the opentelemetry OTLP endpoint.
ASTRIA_AUCTIONEER_NO_OTEL=false

# The OTEL specific config options follow the OpenTelemetry Protocol Exporter v1
# specification as defined here:
Expand Down
10 changes: 7 additions & 3 deletions crates/astria-auctioneer/src/auctioneer/inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ impl Auctioneer {
) -> eyre::Result<Self> {
let Config {
sequencer_grpc_endpoint,
sequencer_abci_endpoint,
latency_margin_ms,
rollup_grpc_endpoint,
rollup_id,
..
} = cfg;
Expand All @@ -57,10 +60,11 @@ impl Auctioneer {
metrics,
shutdown_token: shutdown_token.clone(),
sequencer_grpc_endpoint,
sequencer_abci_endpoint,
rollup_id,
optimistic_execution_grpc_endpoint: todo!(),
bundle_grpc_endpoint: todo!(),
latency_margin: todo!(),
optimistic_execution_grpc_endpoint: rollup_grpc_endpoint.clone(),
bundle_grpc_endpoint: rollup_grpc_endpoint.clone(),
latency_margin: Duration::from_millis(latency_margin_ms),
}
.build()
.wrap_err("failed to initialize the optimistic executor")?;
Expand Down
27 changes: 23 additions & 4 deletions crates/astria-auctioneer/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use astria_core::primitive::v1::asset;
use serde::{
Deserialize,
Serialize,
Expand All @@ -9,6 +10,28 @@ use serde::{
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
/// The single config for creating an astria-auctioneer service.
pub struct Config {
/// The endpoint for the sequencer gRPC service used for the optimistic block stream
pub sequencer_grpc_endpoint: String,
/// The endpoint for the sequencer ABCI service used for submitting the auction winner
/// transaction
pub sequencer_abci_endpoint: String,
/// The chain ID for the sequencer network
pub sequencer_chain_id: String,
/// The file path for the private key used to sign sequencer transactions with the auction
/// results
pub sequencer_private_key_path: String,
// The fee asset denomination to use for the sequnecer transactions.
pub fee_asset_denomination: asset::Denom,
// The address prefix to use when constructing sequencer addresses using the signing key.
pub sequencer_address_prefix: String,
/// The endpoint for the rollup gRPC service used for the optimistic execution and bundle
/// streams
pub rollup_grpc_endpoint: String,
/// The rollup ID used to filter the optimistic blocks stream
pub rollup_id: String,
/// The amount of time in miliseconds to wait after a commit before closing the auction for
/// bids and submitting the result to the sequencer.
pub latency_margin_ms: u64,
/// Log level for the service.
pub log: String,
/// Forces writing trace data to stdout no matter if connected to a tty or not.
Expand All @@ -21,10 +44,6 @@ pub struct Config {
pub metrics_http_listener_addr: String,
/// Writes a human readable format to stdout instead of JSON formatted OTEL trace data.
pub pretty_print: bool,
/// The endpoint for the sequencer gRPC service used for the optimistic block stream
pub sequencer_grpc_endpoint: String,
/// The rollup ID used to filter the optimistic blocks stream
pub rollup_id: String,
}

impl config::Config for Config {
Expand Down
4 changes: 4 additions & 0 deletions crates/astria-auctioneer/src/optimistic_executor/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ pub(crate) struct Builder {
pub(crate) shutdown_token: CancellationToken,
/// The endpoint for the sequencer gRPC service used for the optimistic block stream
pub(crate) sequencer_grpc_endpoint: String,
/// The endpoint for the sequencer ABCI service used to submit the auction winner transaction
pub(crate) sequencer_abci_endpoint: String,
/// The rollup ID for the filtered optimistic block stream
pub(crate) rollup_id: String,
/// The endpoint for the rollup's optimistic execution gRPC service
Expand All @@ -28,6 +30,7 @@ impl Builder {
metrics,
shutdown_token,
sequencer_grpc_endpoint,
sequencer_abci_endpoint,
rollup_id,
optimistic_execution_grpc_endpoint,
bundle_grpc_endpoint,
Expand All @@ -40,6 +43,7 @@ impl Builder {
metrics,
shutdown_token,
sequencer_grpc_endpoint,
sequencer_abci_endpoint,
rollup_id,
optimistic_execution_grpc_endpoint,
bundle_grpc_endpoint,
Expand Down

0 comments on commit 58b4ce8

Please sign in to comment.