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

chore: clean env variable #12239

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
465ee6f
initial pass to clean up unused env variables
aminsammara Feb 23, 2025
16f59f7
Delete BOT_NO_WAIT_FOR_TRANSFER env variable
aminsammara Feb 23, 2025
22ccc95
Delete L2_QUEUE_SIZE env variable
aminsammara Feb 23, 2025
9674a9b
Deleted LOG_ELAPSED_TIME env variable
aminsammara Feb 23, 2025
039cace
Could not resolve NETWORK env variable
aminsammara Feb 23, 2025
5e821f9
Could not remove NO_PXE var
aminsammara Feb 23, 2025
b835a23
Deleted P2P_GOSSIPSUB_TX_INVALID_MESSAGE_DELIVERIES_DECAY env variable
aminsammara Feb 23, 2025
ce39510
Deleted P2P_GOSSIPSUB_TX_INVALID_MESSAGE_DELIVERIES_WEIGHT env var
aminsammara Feb 23, 2025
916eec9
Deleted P2P_GOSSIPSUB_TX_TOPIC_WEIGHT env var
aminsammara Feb 23, 2025
b364bec
Deleted L2_QUEUE_SIZE env var
aminsammara Feb 23, 2025
5a2e6d5
Deleted P2P_TX_PROTOCOL env var
aminsammara Feb 23, 2025
f638fdd
Deleted PROVER_DISABLED env var
aminsammara Feb 23, 2025
c27ac0f
Deleted PROVER_JOB_POLL_INTERVAL_MS env var
aminsammara Feb 23, 2025
777e8fb
Deleted SEQ_REQUIRED_CONFIRMATIONS and PROVER_REQUIRED_CONFIRMATIONS …
aminsammara Feb 23, 2025
0060d1b
Deleted PROVER_JOB_TIMEOUT_MS env var
aminsammara Feb 23, 2025
3b5139f
Deleted L1_GAS_LIMIT_BUFFER_FIXED env var
aminsammara Feb 23, 2025
1cfab69
Removed none from feepayment methods
aminsammara Feb 24, 2025
29a52d6
none
aminsammara Feb 24, 2025
6f85da7
f
aminsammara Feb 24, 2025
a5cdf70
changed DLAZY to match D
aminsammara Feb 24, 2025
8c50b8a
removed TODO for flood publish
aminsammara Feb 24, 2025
67c2409
Fixed doubleSpendSeverePeerPenaltyWindow
aminsammara Feb 24, 2025
96aa989
Removed Peer Severity Double Window TODO
aminsammara Feb 24, 2025
18799b8
Removed env variable related to Proof Verifier
aminsammara Feb 24, 2025
ca68058
Removed more proof verifier
aminsammara Feb 24, 2025
5a2f83f
removed PROVER_BROKER_ENABLED from env file
aminsammara Feb 24, 2025
a8d50ff
Deleted L1_GAS_PRICE_MIN env var
aminsammara Feb 24, 2025
7b9a3ab
Better TODO for API_PREFIX
aminsammara Feb 24, 2025
ad83415
rebase
aminsammara Feb 26, 2025
81a01ad
Merge branch 'master' into amin/cleanenv
aminsammara Feb 26, 2025
cea8b93
removed minGwei from tests
aminsammara Feb 27, 2025
506f144
reverted some gossipsub changes
aminsammara Feb 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docker-compose.provernet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ services:
BOT_TX_INTERVAL_SECONDS: 300
BOT_PRIVATE_TRANSFERS_PER_TX: 1
BOT_PUBLIC_TRANSFERS_PER_TX: 0
BOT_NO_WAIT_FOR_TRANSFERS: true
BOT_NO_START: false
BOT_MAX_CONSECUTIVE_ERRORS: 3
BOT_STOP_WHEN_UNHEALTHY: true
Expand Down
150 changes: 78 additions & 72 deletions spartan/releases/testnet/aztec-spartan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,90 +137,95 @@ get_public_ip() {
}

get_node_info() {
echo -e "${BLUE}Fetching node info...${NC}"
CMD="get-node-info --node-url ${BOOTNODE_URL} --json"
# TODO: use the correct (corresponding) image
# Can't do it today because `release/unhinged-unicorn` doesn't support --json flag
NODE_INFO=$(curl -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","method":"node_getNodeInfo","params":[],"id":1}' -s ${BOOTNODE_URL})

# Extract the relevant fields
result=$(echo $NODE_INFO | jq -r '.result')
L1_CHAIN_ID=$(echo $result | jq -r '.l1ChainId')
BOOTSTRAP_NODES=$(echo $result | jq -r '.enr')
REGISTRY_CONTRACT_ADDRESS=$(echo $result | jq -r '.l1ContractAddresses.registryAddress')
GOVERNANCE_PROPOSER_CONTRACT_ADDRESS=$(echo $result | jq -r '.l1ContractAddresses.governanceProposerAddress')
FEE_JUICE_CONTRACT_ADDRESS=$(echo $result | jq -r '.l1ContractAddresses.feeJuiceAddress')
ROLLUP_CONTRACT_ADDRESS=$(echo $result | jq -r '.l1ContractAddresses.rollupAddress')
REWARD_DISTRIBUTOR_CONTRACT_ADDRESS=$(echo $result | jq -r '.l1ContractAddresses.rewardDistributorAddress')
GOVERNANCE_CONTRACT_ADDRESS=$(echo $result | jq -r '.l1ContractAddresses.governanceAddress')
COIN_ISSUER_CONTRACT_ADDRESS=$(echo $result | jq -r '.l1ContractAddresses.coinIssuerAddress')
FEE_JUICE_PORTAL_CONTRACT_ADDRESS=$(echo $result | jq -r '.l1ContractAddresses.feeJuicePortalAddress')
INBOX_CONTRACT_ADDRESS=$(echo $result | jq -r '.l1ContractAddresses.inboxAddress')
OUTBOX_CONTRACT_ADDRESS=$(echo $result | jq -r '.l1ContractAddresses.outboxAddress')

echo -e "${GREEN}Node info fetched successfully${NC}"
return 0
echo -e "${BLUE}Fetching node info...${NC}"
CMD="get-node-info --node-url ${BOOTNODE_URL} --json"
# TODO: use the correct (corresponding) image
# Can't do it today because `release/unhinged-unicorn` doesn't support --json flag
NODE_INFO=$(curl -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","method":"node_getNodeInfo","params":[],"id":1}' -s ${BOOTNODE_URL})

# Extract the relevant fields
result=$(echo $NODE_INFO | jq -r '.result')
L1_CHAIN_ID=$(echo $result | jq -r '.l1ChainId')
BOOTSTRAP_NODES=$(echo $result | jq -r '.enr')
REGISTRY_CONTRACT_ADDRESS=$(echo $result | jq -r '.l1ContractAddresses.registryAddress')
GOVERNANCE_PROPOSER_CONTRACT_ADDRESS=$(echo $result | jq -r '.l1ContractAddresses.governanceProposerAddress')
FEE_JUICE_CONTRACT_ADDRESS=$(echo $result | jq -r '.l1ContractAddresses.feeJuiceAddress')
ROLLUP_CONTRACT_ADDRESS=$(echo $result | jq -r '.l1ContractAddresses.rollupAddress')
REWARD_DISTRIBUTOR_CONTRACT_ADDRESS=$(echo $result | jq -r '.l1ContractAddresses.rewardDistributorAddress')
GOVERNANCE_CONTRACT_ADDRESS=$(echo $result | jq -r '.l1ContractAddresses.governanceAddress')
COIN_ISSUER_CONTRACT_ADDRESS=$(echo $result | jq -r '.l1ContractAddresses.coinIssuerAddress')
FEE_JUICE_PORTAL_CONTRACT_ADDRESS=$(echo $result | jq -r '.l1ContractAddresses.feeJuicePortalAddress')
INBOX_CONTRACT_ADDRESS=$(echo $result | jq -r '.l1ContractAddresses.inboxAddress')
OUTBOX_CONTRACT_ADDRESS=$(echo $result | jq -r '.l1ContractAddresses.outboxAddress')
STAKING_ASSET_CONTRACT_ADDRESS=$(echo $result | jq -r '.l1ContractAddresses.stakingContractAddress')
SLASH_FACTORY_CONTRACT_ADDRESS=$(echo $result | jq -r '.l1ContractAddresses.slashingContractAddress')



echo -e "${GREEN}Node info fetched successfully${NC}"
return 0
}

# Configure environment
configure_environment() {
local args=("$@")
parse_args "${args[@]}"
local args=("$@")
parse_args "${args[@]}"

echo -e "${BLUE}Configuring environment...${NC}"
if [ -n "$NETWORK" ]; then
NETWORK="$NETWORK"
else
read -p "Network [unhinged-unicorn]: " NETWORK
NETWORK=${NETWORK:-unhinged-unicorn}
fi
echo -e "${BLUE}Configuring environment...${NC}"
if [ -n "$NETWORK" ]; then
NETWORK="$NETWORK"
else
read -p "Network [mitch]: " NETWORK
NETWORK=${NETWORK:-mitch}
fi

# if the network is `unhinged-unicorn`
if [ "$NETWORK" = "unhinged-unicorn" ]; then
BOOTNODE_URL="${BOOTNODE_URL:-http://34.169.19.201:8080}"
ETHEREUM_HOSTS="${ETHEREUM_HOSTS:-http://34.82.214.254:8545}"
IMAGE="${IMAGE:-aztecprotocol/aztec:unhinged-unicorn}"
else
# unknown network
echo -e "${RED}Unknown network: $NETWORK${NC}"
fi
# if the network is `unhinged-unicorn`
if [ "$NETWORK" = "mitch" ]; then
BOOTNODE_URL="${BOOTNODE_URL:-http://34.145.47.90:8080}"
ETHEREUM_HOST="${ETHEREUM_HOST:-http://34.169.138.115:8545}"
L1_CONSENSUS_HOST_URL="${L1_CONSENSUS_HOST_URL:-35.227.182.215:5052}"
IMAGE="${IMAGE:-aztecprotocol/aztec:430adc4a99ff8f1cbe8cf0865ab65164260bc0ab}"
else
# unknown network
echo -e "${RED}Unknown network: $NETWORK${NC}"
fi

# Check that bootnode, ethereum host, and image are set
if [ -z "$BOOTNODE_URL" ] || [ -z "$ETHEREUM_HOSTS" ] || [ -z "$IMAGE" ]; then
echo -e "${RED}Bootnode, Ethereum host, and image are required${NC}"
exit 1
fi
# Check that bootnode, ethereum host, and image are set
if [ -z "$BOOTNODE_URL" ] || [ -z "$ETHEREUM_HOST" ] || [ -z "$IMAGE" ] || [ -z "$L1_CONSENSUS_HOST_URL"]; then
echo -e "${RED}Bootnode, Ethereum host, and image are required${NC}"
exit 1
fi

# get the node info
get_node_info
# get the node info
get_node_info

if [ -n "$CLI_P2P_PORT" ]; then
P2P_PORT="$CLI_P2P_PORT"
else
read -p "P2P Port [$DEFAULT_P2P_PORT]: " P2P_PORT
P2P_PORT=${P2P_PORT:-$DEFAULT_P2P_PORT}
fi

if [ -n "$CLI_PORT" ]; then
PORT="$CLI_PORT"
else
read -p "Node Port [$DEFAULT_PORT]: " PORT
PORT=${PORT:-$DEFAULT_PORT}
fi
if [ -n "$CLI_P2P_PORT" ]; then
P2P_PORT="$CLI_P2P_PORT"
else
read -p "P2P Port [$DEFAULT_P2P_PORT]: " P2P_PORT
P2P_PORT=${P2P_PORT:-$DEFAULT_P2P_PORT}
fi

if [ -n "$CLI_KEY" ]; then
KEY="$CLI_KEY"
else
while true; do
read -p "Validator Private Key: " KEY
if [ -z "$KEY" ]; then
echo -e "${RED}Error: Validator Private Key is required${NC}"
else
break
fi
done
fi
if [ -n "$CLI_PORT" ]; then
PORT="$CLI_PORT"
else
read -p "Node Port [$DEFAULT_PORT]: " PORT
PORT=${PORT:-$DEFAULT_PORT}
fi

if [ -n "$CLI_KEY" ]; then
KEY="$CLI_KEY"
else
while true; do
read -p "Validator Private Key: " KEY
if [ -z "$KEY" ]; then
echo -e "${RED}Error: Validator Private Key is required${NC}"
else
break
fi
done
fi
if [ -n "$CLI_COINBASE" ]; then
COINBASE="$CLI_COINBASE"
else
Expand Down Expand Up @@ -293,6 +298,7 @@ AZTEC_EPOCH_DURATION=32
AZTEC_PROOF_SUBMISSION_WINDOW=64
BOOTSTRAP_NODES=${BOOTSTRAP_NODES}
REGISTRY_CONTRACT_ADDRESS=${REGISTRY_CONTRACT_ADDRESS}
STAKING_ASSET_CONTRACT_ADDRESS=${}
GOVERNANCE_PROPOSER_CONTRACT_ADDRESS=${GOVERNANCE_PROPOSER_CONTRACT_ADDRESS}
FEE_JUICE_CONTRACT_ADDRESS=${FEE_JUICE_CONTRACT_ADDRESS}
ROLLUP_CONTRACT_ADDRESS=${ROLLUP_CONTRACT_ADDRESS}
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/aztec-faucet/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type L1AssetConfig = {
export type FaucetConfig = L1ReaderConfig & {
l1Mnemonic: string;
mnemonicAccountIndex: number;
interval: number;
faucetInterval: number;
ethAmount: string;
l1Assets: L1AssetConfig[];
};
Expand All @@ -26,7 +26,7 @@ export const faucetConfigMapping: ConfigMappingsType<FaucetConfig> = {
description: 'The account to use',
...numberConfigHelper(0),
},
interval: {
faucetInterval: {
env: 'FAUCET_INTERVAL_MS',
description: 'How often the faucet can be dripped',
...numberConfigHelper(1 * 60 * 60 * 1000), // 1 hour
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec-faucet/src/faucet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export class Faucet {

const now = this.timeFn();
const last = addressHistory.get(asset);
if (typeof last === 'number' && last + this.config.interval > now) {
if (typeof last === 'number' && last + this.config.faucetInterval > now) {
throw new ThrottleError(address.toString(), asset);
}
}
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/aztec/terraform/node/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ resource "aws_ecs_task_definition" "aztec-node" {
value = tostring(var.P2P_TX_POOL_KEEP_PROVEN_FOR)
},
{
name = "P2P_SEVERE_PEER_PENALTY_BLOCK_LENGTH"
value = tostring(var.P2P_SEVERE_PEER_PENALTY_BLOCK_LENGTH)
name = "P2P_DOUBLE_SPEND_SEVERE_PEER_PENALTY_WINDOW"
value = tostring(var.P2P_DOUBLE_SPEND_SEVERE_PEER_PENALTY_WINDOW)
},
{
name = "P2P_GOSSIPSUB_INTERVAL_MS"
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec/terraform/node/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ variable "P2P_GOSSIPSUB_MCACHE_GOSSIP" {
default = 3
}

variable "P2P_SEVERE_PEER_PENALTY_BLOCK_LENGTH" {
variable "P2P_DOUBLE_SPEND_SEVERE_PEER_PENALTY_WINDOW" {
type = number
default = 30
}
Expand Down
2 changes: 0 additions & 2 deletions yarn-project/aztec/terraform/proof-verifier/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ resource "aws_ecs_task_definition" "aztec-proof-verifier" {
}
]
environment = [
{ name = "PROOF_VERIFIER_L1_START_BLOCK", value = "15918000" },
{ name = "PROOF_VERIFIER_POLL_INTERVAL_MS", value = tostring(var.PROOF_VERIFIER_POLL_INTERVAL_MS) },
{ name = "ETHEREUM_HOSTS", value = var.ETHEREUM_HOSTS },
{ name = "L1_CHAIN_ID", value = tostring(var.L1_CHAIN_ID) },
{ name = "ROLLUP_CONTRACT_ADDRESS", value = var.ROLLUP_CONTRACT_ADDRESS },
Expand Down
7 changes: 1 addition & 6 deletions yarn-project/aztec/terraform/proof-verifier/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,4 @@ variable "L1_CHAIN_ID" {

variable "ROLLUP_CONTRACT_ADDRESS" {
type = string
}

variable "PROOF_VERIFIER_POLL_INTERVAL_MS" {
type = number
default = 60000
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export LOG_LEVEL=${LOG_LEVEL:-"verbose"}
export BOT_TX_INTERVAL_SECONDS="5"
export BOT_PRIVATE_TRANSFERS_PER_TX="1"
export BOT_PUBLIC_TRANSFERS_PER_TX="0"
export BOT_NO_WAIT_FOR_TRANSFERS="true"
export BOT_FOLLOW_CHAIN="NONE"
export BOT_NO_START="false"
export PXE_PROVER_ENABLED="false"
Expand Down
1 change: 0 additions & 1 deletion yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ export class P2PNetworkTest {
{
gasLimitBufferPercentage: 20,
maxGwei: 500n,
minGwei: 1n,
maxAttempts: 3,
checkIntervalMs: 100,
stallTimeMs: 1000,
Expand Down
1 change: 0 additions & 1 deletion yarn-project/end-to-end/src/e2e_synching.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,6 @@ describe('e2e_synching', () => {
const publisher = new SequencerPublisher(
{
l1RpcUrls: config.l1RpcUrls,
requiredConfirmations: 1,
l1Contracts: deployL1ContractsValues.l1ContractAddresses,
publisherPrivateKey: sequencerPK,
l1PublishRetryIntervalMS: 100,
Expand Down
1 change: 0 additions & 1 deletion yarn-project/end-to-end/src/fixtures/setup_p2p_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ export async function createValidatorConfig(
p2pEnabled: true,
peerCheckIntervalMS: TEST_PEER_CHECK_INTERVAL_MS,
blockCheckIntervalMS: 1000,
transactionProtocol: '',
dataDirectory,
bootstrapNodes: bootstrapNodeEnr ? [bootstrapNodeEnr] : [],
};
Expand Down
3 changes: 0 additions & 3 deletions yarn-project/ethereum/src/l1_tx_utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ describe('GasUtils', () => {
gasUtils = new L1TxUtilsWithBlobs(publicClient, walletClient, logger, {
gasLimitBufferPercentage: 20,
maxGwei: 500n,
minGwei: 1n,
maxAttempts: 3,
checkIntervalMs: 100,
stallTimeMs: 1000,
Expand Down Expand Up @@ -196,7 +195,6 @@ describe('GasUtils', () => {
const baselineGasUtils = new L1TxUtilsWithBlobs(publicClient, walletClient, logger, {
gasLimitBufferPercentage: 0,
maxGwei: 500n,
minGwei: 10n, // Increased minimum gas price
maxAttempts: 5,
checkIntervalMs: 100,
stallTimeMs: 1000,
Expand All @@ -216,7 +214,6 @@ describe('GasUtils', () => {
const bufferedGasUtils = new L1TxUtilsWithBlobs(publicClient, walletClient, logger, {
gasLimitBufferPercentage: 20,
maxGwei: 500n,
minGwei: 1n,
maxAttempts: 3,
checkIntervalMs: 100,
stallTimeMs: 1000,
Expand Down
9 changes: 0 additions & 9 deletions yarn-project/ethereum/src/l1_tx_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ export interface L1TxUtilsConfig {
* Maximum gas price in gwei
*/
maxGwei?: bigint;
/**
* Minimum gas price in gwei
*/
minGwei?: bigint;
/**
* Maximum blob fee per gas in gwei
*/
Expand Down Expand Up @@ -108,11 +104,6 @@ export const l1TxUtilsConfigMappings: ConfigMappingsType<L1TxUtilsConfig> = {
env: 'L1_GAS_LIMIT_BUFFER_PERCENTAGE',
...numberConfigHelper(20),
},
minGwei: {
description: 'Minimum gas price in gwei',
env: 'L1_GAS_PRICE_MIN',
...bigintConfigHelper(1n),
},
maxGwei: {
description: 'Maximum gas price in gwei',
env: 'L1_GAS_PRICE_MAX',
Expand Down
Loading
Loading