Skip to content

Commit

Permalink
Merge branch 'main' into feat/signer-jannik
Browse files Browse the repository at this point in the history
# Conflicts:
#	stacking/stacking.ts
#	stacks-krypton-follower.toml
#	stacks-krypton-miner.toml
  • Loading branch information
janniks committed Sep 26, 2024
2 parents 10cd9f8 + 71c1492 commit 4b1c988
Show file tree
Hide file tree
Showing 10 changed files with 83 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.e2e
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

FROM rust:bookworm as builder
FROM rust:bookworm AS builder

# A commit hash, tag, or branch
ARG GIT_COMMIT=d0f5712332619b3140badc2d25856975d2747004
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.stacker
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20-bookworm as builder
FROM node:20-bookworm AS builder

RUN apt-get update && apt-get install -y curl gettext-base jq

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.stacks-api
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20-bookworm as builder
FROM node:20-bookworm AS builder

ARG GIT_COMMIT
RUN test -n "$GIT_COMMIT" || (echo "GIT_COMMIT not set" && false)
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.stacks-node
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:bookworm as builder
FROM rust:bookworm AS builder

# TODO: is there a built-in required arg syntax?
ARG GIT_COMMIT
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ services:
SLEEP_DURATION=$${MINE_INTERVAL}
BLOCK_HEIGHT=$$(bitcoin-cli -rpcconnect=bitcoind getblockcount)
if [ "$${BLOCK_HEIGHT}" -gt $$(( $${STACKS_30_HEIGHT} + 1 )) ]; then
if [ "$${BLOCK_HEIGHT}" -ge "$${STACKS_30_HEIGHT}" ]; then
echo "In Epoch3, sleeping for $${MINE_INTERVAL_EPOCH3} ..."
SLEEP_DURATION=$${MINE_INTERVAL_EPOCH3}
elif [ "$${BLOCK_HEIGHT}" -gt $$(( $${STACKS_25_HEIGHT} + 1 )) ]; then
elif [ "$${BLOCK_HEIGHT}" -ge "$${STACKS_25_HEIGHT}" ]; then
echo "In Epoch2.5, sleeping for $${MINE_INTERVAL_EPOCH25} ..."
SLEEP_DURATION=$${MINE_INTERVAL_EPOCH25}
fi
Expand Down
13 changes: 9 additions & 4 deletions stacking/stacking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const randInt = () => crypto.randomInt(0, 0xffffffffffff);
const stackingInterval = parseEnvInt('STACKING_INTERVAL', true);
const postTxWait = parseEnvInt('POST_TX_WAIT', true);
const stackingCycles = parseEnvInt('STACKING_CYCLES', true);
const stackAmount = parseEnvInt('STACK_AMOUNT_STX', false);

let startTxFee = 1000;
const getNextTxFee = () => startTxFee++;
Expand Down Expand Up @@ -106,12 +107,16 @@ async function run() {
}

async function stackStx(poxInfo: PoxInfo, account: Account) {
// Bump min threshold by 25% to avoid getting stuck if threshold increases
const minStx = Math.floor(poxInfo.next_cycle.min_threshold_ustx * 1.25);
const amountToStx = BigInt(minStx) * BigInt(account.targetSlots);
// Bump min threshold by 50% to avoid getting stuck if threshold increases
const minStx = Math.floor(poxInfo.next_cycle.min_threshold_ustx * 1.5);
let amountToStx = BigInt(minStx) * BigInt(account.targetSlots);
if (typeof stackAmount === 'number') {
amountToStx = BigInt(stackAmount) * 1_000_000n;
}

if (amountToStx > account.balance) {
throw new Error(
`Insufficient balance to stack-stx (amount=${amountToStx}, balance=${account.balance})`
`Insufficient balance to stack-stx (amount=${amountToStx}, balance=${account.info.balance})`
);
}
const authId = randInt();
Expand Down
2 changes: 1 addition & 1 deletion stacking/tx-broadcaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ async function loop() {
try {
await run();
} catch (e) {
logger.error('Error submitting stx-transfer tx:', e);
logger.error(e, 'Error in tx-broadcaster loop');
}
await new Promise(resolve => setTimeout(resolve, broadcastInterval * 1000));
}
Expand Down
75 changes: 55 additions & 20 deletions stacks-krypton-follower.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,35 +72,38 @@ epoch_name = "2.3"
start_height = $STACKS_24_HEIGHT

epoch_name = "2.4"



[[ustx_balance]]
address = "STB44HYPYAT2BB2QE513NSP81HTMYWBJP02HPGK6"
amount = 10000000000000000
amount = 1000000000000000
# secretKey = "cb3df38053d132895220b9ce471f6b676db5b9bf0b4adefb55f2118ece2478df01"

[[ustx_balance]]
address = "ST11NJTTKGVT6D1HY4NJRVQWMQM7TVAR091EJ8P2Y"
amount = 10000000000000000
amount = 1000000000000000
# secretKey = "21d43d2ae0da1d9d04cfcaac7d397a33733881081f0b2cd038062cf0ccbb752601"

[[ustx_balance]]
address = "ST1HB1T8WRNBYB0Y3T7WXZS38NKKPTBR3EG9EPJKR"
amount = 10000000000000000
amount = 1000000000000000
# Account keys 3
# secretKey = "c71700b07d520a8c9731e4d0f095aa6efb91e16e25fb27ce2b72e7b698f8127a01"

[[ustx_balance]]
address = "ST2PGGD0ZXAWEMY4EZ025RD1X47EEVH287SQKA8BC"
amount = 10000000000000000
amount = 1000000000000000
# Account keys 2
# secretKey = "975b251dd7809469ef0c26ec3917971b75c51cd73a022024df4bf3b232cc2dc001"

[[ustx_balance]]
address = "ST29V10QEA7BRZBTWRFC4M70NJ4J6RJB5P1C6EE84"
amount = 10000000000000000
amount = 1000000000000000
# Account keys 1
# secretKey = "0d2f965b472a82efd5a96e6513c8b9f7edc725d5c96c7d35d6c722cedeb80d1b01"

# Stacker/signer
# Stacker/Signer (signer-3)
[[ustx_balance]]
address = "ST3AM1A56AK2C1XAFJ4115ZSV26EB49BVQ10MGCS0"
amount = 10000000000000000
Expand All @@ -109,31 +112,63 @@ amount = 10000000000000000
# stx_address: ST3AM1A56AK2C1XAFJ4115ZSV26EB49BVQ10MGCS0
# btc_address: mzxXgV6e4BZSsz8zVHm3TmqbECt7mbuErt

# Stacker/signer
# Stacker/Signer (signer-2, also in Devnet)
[[ustx_balance]]
address = "ST3PF13W7Z0RRM42A8VZRVFQ75SV1K26RXEP8YGKJ"
address = "ST1SJ3DTE5DN7X54YDH5D64R3BCB6A2AG2ZQ8YPD5"
amount = 10000000000000000
# secret_key: 7287ba251d44a4d3fd9276c88ce34c5c52a038955511cccaf77e61068649c17801
# mnemonic = "prevent gallery kind limb income control noise together echo rival record wedding sense uncover school version force bleak nuclear include danger skirt enact arrow"
# stx_address: ST3PF13W7Z0RRM42A8VZRVFQ75SV1K26RXEP8YGKJ
# btc_address: n37mwmru2oaVosgfuvzBwgV2ysCQRrLko7
# secretKey = 7287ba251d44a4d3fd9276c88ce34c5c52a038955511cccaf77e61068649c17801

# Stacker/signer
# Stacker/Signer (signer-1, also in Devnet)
[[ustx_balance]]
address = "ST3NBRSFKX28FQ2ZJ1MAKX58HKHSDGNV5N7R21XCP"
address = "ST2CY5V39NHDPWSXMW9QDT3HC3GD6Q6XX4CFRK9AG"
amount = 10000000000000000
# secret_key: 530d9f61984c888536871c6573073bdfc0058896dc1adfe9a6a10dfacadc209101
# mnemonic = "female adjust gallery certain visit token during great side clown fitness like hurt clip knife warm bench start reunion globe detail dream depend fortune"
# stx_address: ST3NBRSFKX28FQ2ZJ1MAKX58HKHSDGNV5N7R21XCP
# btc_address: n2v875jbJ4RjBnTjgbfikDfnwsDV5iUByw
# secretKey = 530d9f61984c888536871c6573073bdfc0058896dc1adfe9a6a10dfacadc209101

# Stacker/Signer (also in Devnet)
[[ustx_balance]]
address = "ST5B3TD6YF085JWKSSW9HDWCDZTR842RFNP19HQC"
address = "ST2JHG361ZXG51QTKY2NQCVBPPRRE2KZB1HR05NNC"
amount = 10000000000000000
# secretKey = d655b2523bcd65e34889725c73064feb17ceb796831c0e111ba1a552b0f31b3901

# Signer (signer-5)
[[ustx_balance]]
address = "STHJZMGZWCWHBZKDD90GCSN4KEFSTQX05NEJ2BDD"
amount = 10000000000000000
# secret_key: f43fcfe1c5c9c5e2f8a4ee1d10225d000c3055e9510e39cc2d9b03571cd0f53f01
# mnemonic = "conduct echo virtual chalk warrior cake master return fuel online dolphin alert hole cloth rapid cave today unfair flight heart dog candy mad adult"
# stx_address: STHJZMGZWCWHBZKDD90GCSN4KEFSTQX05NEJ2BDD
# btc_address: mij1ER3qsDE2CJ3XriNNiy1kYyZQcTS9AD

[[ustx_balance]]
address = "ST5B3TD6YF085JWKSSW9HDWCDZTR842RFNP19HQC"
amount = 1000000000000000
# used in "flood.ts"
# secretKey = 66b7a77a3e0abc2cddaa51ed38fc4553498e19d3620ef08eb141afcfd0e3f5b501

[[ustx_balance]]
address = "STEH2J3C05BAHYS0RBAQBANJ1AXR6SR43VMZ0D49"
amount = 10000000000000000
amount = 1000000000000000
# secretKey = 5b8303150239eceaba43892af7cdd1fa7fc26eda5182ebaaa568e3341d54a4d001

# MORE DEVNET WALLETS
# Signer (signer-4)
[[ustx_balance]]
address = "ST2NEB84ASENDXKYGJPQW86YXQCEFEX2ZQPG87ND"
amount = 10000000000000000
# secretKey = f9d7206a47f14d2870c163ebab4bf3e70d18f5d14ce1031f3902fbbc894fe4c701

[[ustx_balance]]
address = "ST2REHHS5J3CERCRBEPMGH7921Q6PYKAADT7JP2VB"
amount = 10000000000000000
# secretKey = 3eccc5dac8056590432db6a35d52b9896876a3d5cbdea53b72400bc9c2099fe801

[[ustx_balance]]
address = "ST3AM1A56AK2C1XAFJ4115ZSV26EB49BVQ10MGCS0"
amount = 10000000000000000
# secretKey = 7036b29cb5e235e5fd9b09ae3e8eec4404e44906814d5d01cbca968a60ed4bfb01

[[ustx_balance]]
address = "STT8DSJTWAW9TVJ1B17SD3S6F7SYH4TXG7TWS7Q9"
amount = 10000000000000000
# privateKey = 16226f674796712dfbd53bf402304579b8b6d04d4bed4d466bf84ce6db973d4401
# mnemonic = "essay grief twin tube concert idea prosper good alarm goddess shell glare hurt belt endless patch lumber wrap labor body erupt brown style test"
6 changes: 6 additions & 0 deletions stacks-krypton-miner-follower.toml
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,9 @@ amount = 10000000000000000
address = "ST3AM1A56AK2C1XAFJ4115ZSV26EB49BVQ10MGCS0"
amount = 10000000000000000
# secretKey = 7036b29cb5e235e5fd9b09ae3e8eec4404e44906814d5d01cbca968a60ed4bfb01

[[ustx_balance]]
address = "STT8DSJTWAW9TVJ1B17SD3S6F7SYH4TXG7TWS7Q9"
amount = 10000000000000000
# privateKey = 16226f674796712dfbd53bf402304579b8b6d04d4bed4d466bf84ce6db973d4401
# mnemonic = "essay grief twin tube concert idea prosper good alarm goddess shell glare hurt belt endless patch lumber wrap labor body erupt brown style test"
6 changes: 6 additions & 0 deletions stacks-krypton-miner.toml
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,9 @@ amount = 10000000000000000
address = "ST3AM1A56AK2C1XAFJ4115ZSV26EB49BVQ10MGCS0"
amount = 10000000000000000
# secretKey = 7036b29cb5e235e5fd9b09ae3e8eec4404e44906814d5d01cbca968a60ed4bfb01

[[ustx_balance]]
address = "STT8DSJTWAW9TVJ1B17SD3S6F7SYH4TXG7TWS7Q9"
amount = 10000000000000000
# privateKey = 16226f674796712dfbd53bf402304579b8b6d04d4bed4d466bf84ce6db973d4401
# mnemonic = "essay grief twin tube concert idea prosper good alarm goddess shell glare hurt belt endless patch lumber wrap labor body erupt brown style test"

0 comments on commit 4b1c988

Please sign in to comment.