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

feat: epoch cache, do not attest if not in committee or from current proposer #10327

Merged
merged 29 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e2d7829
feat: delete attestations older than a slot
Maddiaa0 Nov 30, 2024
67ea59c
fmt
Maddiaa0 Nov 30, 2024
b95bcef
test: attestation pool pruning
Maddiaa0 Nov 30, 2024
f6ac466
fmt
Maddiaa0 Nov 30, 2024
e67eaef
feat: epoch cache, do not attest if not in committee or from current …
Maddiaa0 Nov 30, 2024
0265e47
cleanup
Maddiaa0 Nov 30, 2024
6a795ea
test: validator client tests
Maddiaa0 Nov 30, 2024
50eaa4c
fmt
Maddiaa0 Nov 30, 2024
98b118a
fmt + test
Maddiaa0 Dec 2, 2024
6507c02
tmp
Maddiaa0 Dec 3, 2024
97f35c3
fix: next and current slot
Maddiaa0 Dec 5, 2024
7003114
fmt
Maddiaa0 Dec 5, 2024
452e781
Merge branch 'master' into md/epoch-cache--
Maddiaa0 Dec 5, 2024
8c8df0c
post merge fix
Maddiaa0 Dec 5, 2024
e2b43fb
fix: ordering
Maddiaa0 Dec 5, 2024
e0976bb
fix: ordering
Maddiaa0 Dec 5, 2024
da87b55
fix
Maddiaa0 Dec 5, 2024
5fc9900
fix: linter and test
just-mitch Dec 5, 2024
17353cf
Merge branch 'master' into md/epoch-cache--
just-mitch Dec 5, 2024
bcbcccd
fix: merge conflicts
just-mitch Dec 5, 2024
1309414
fix: function ordering and p2p tests
just-mitch Dec 5, 2024
6aba551
fix: reex test - sending same proposal twice in one slot
Maddiaa0 Dec 6, 2024
82da16b
fix: for a slot ci runner, decrease the time jump length
Maddiaa0 Dec 6, 2024
13ec8e4
fix: epoch cache flake
Maddiaa0 Dec 6, 2024
676b7ed
fix: in native testnet, deploy validators at genesis
Maddiaa0 Dec 6, 2024
ca99658
fix: run interleaved
Maddiaa0 Dec 6, 2024
e955e8d
fix: earthfile
Maddiaa0 Dec 6, 2024
dd88dbf
Merge branch 'master' into md/epoch-cache--
Maddiaa0 Dec 6, 2024
38f4b15
fix: unused import
just-mitch Dec 6, 2024
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
3 changes: 2 additions & 1 deletion scripts/run_interleaved.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ trap cleanup SIGINT SIGTERM EXIT

# Function to run a command and prefix the output with color
function run_command() {
local cmd="$1"
# Take first 3 parts of command to display inline
local cmd=$(echo "$1" | awk '{print $1" "$2" "$3}')
Maddiaa0 marked this conversation as resolved.
Show resolved Hide resolved
local color="$2"
$cmd 2>&1 | while IFS= read -r line; do
echo -e "${color}[$cmd]\e[0m $line"
Expand Down
2 changes: 1 addition & 1 deletion scripts/run_native_testnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ cd $(git rev-parse --show-toplevel)
# Base command
BASE_CMD="INTERLEAVED=$INTERLEAVED ./yarn-project/end-to-end/scripts/native_network_test.sh \
$TEST_SCRIPT \
./deploy-l1-contracts.sh \
\"./deploy-l1-contracts.sh $NUM_VALIDATORS\" \
./deploy-l2-contracts.sh \
./boot-node.sh \
./ethereum.sh \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# Get the name of the script without the path and extension
SCRIPT_NAME=$(basename "$0" .sh)
REPO=$(git rev-parse --show-toplevel)

# Redirect stdout and stderr to <script_name>.log while also printing to the console
exec > >(tee -a "$(dirname $0)/logs/${SCRIPT_NAME}.log") 2> >(tee -a "$(dirname $0)/logs/${SCRIPT_NAME}.log" >&2)
Expand All @@ -13,7 +14,9 @@ set -eu
# Check for validator addresses
if [ $# -gt 0 ]; then
INIT_VALIDATORS="true"
VALIDATOR_ADDRESSES="$1"
NUMBER_OF_VALIDATORS="$1"
# Generate validator keys, this will set the VALIDATOR_ADDRESSES variable
source $REPO/yarn-project/end-to-end/scripts/native-network/generate-aztec-validator-keys.sh $NUMBER_OF_VALIDATORS
else
INIT_VALIDATORS="false"
fi
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

# Generate Aztec validator keys

NUMBER_OF_KEYS=${1:-16}
MNEMONIC=${2:-"test test test test test test test test test test test junk"}

# Initialize arrays to store private keys and addresses
declare -a VALIDATOR_PRIVATE_KEYS
declare -a VALIDATOR_ADDRESSES_LIST

for i in $(seq 0 $(($NUMBER_OF_KEYS - 1))); do
# Get private key and store it in array
PRIVATE_KEY=$(cast wallet private-key "$MNEMONIC" --mnemonic-index $i)
VALIDATOR_PRIVATE_KEYS+=("$PRIVATE_KEY")

# Get address from private key and store it in array
ADDRESS=$(cast wallet address "$PRIVATE_KEY")
VALIDATOR_ADDRESSES_LIST+=("$ADDRESS")
done

# Join addresses with commas
VALIDATOR_ADDRESSES=$(IFS=, ; echo "${VALIDATOR_ADDRESSES_LIST[*]}")

# Optionally, if you need the arrays for further use, you can export them:
export VALIDATOR_PRIVATE_KEYS
export VALIDATOR_ADDRESSES_LIST
export VALIDATOR_ADDRESSES
9 changes: 5 additions & 4 deletions yarn-project/end-to-end/scripts/native-network/validator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,12 @@ else
node --no-warnings "$REPO"/yarn-project/aztec/dest/bin/index.js add-l1-validator --validator $ADDRESS --rollup $ROLLUP_CONTRACT_ADDRESS && break
sleep 1
done
fi

# Fast forward epochs if we're on an anvil chain
if [ "$IS_ANVIL" = "true" ]; then
node --no-warnings "$REPO"/yarn-project/aztec/dest/bin/index.js fast-forward-epochs --rollup $ROLLUP_CONTRACT_ADDRESS --count 1
# Fast forward epochs if we're on an anvil chain
if [ "$IS_ANVIL" = "true" ]; then
node --no-warnings "$REPO"/yarn-project/aztec/dest/bin/index.js fast-forward-epochs --rollup $ROLLUP_CONTRACT_ADDRESS --count 1
fi
fi

# Start the Validator Node with the sequencer and archiver
node --no-warnings "$REPO"/yarn-project/aztec/dest/bin/index.js start --port="$PORT" --node --archiver --sequencer
13 changes: 7 additions & 6 deletions yarn-project/end-to-end/scripts/native-network/validators.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -eu

# Get the name of the script without the path and extension
SCRIPT_NAME=$(basename "$0" .sh)
REPO=$(git rev-parse --show-toplevel)

# Redirect stdout and stderr to <script_name>.log while also printing to the console
exec > >(tee -a "$(dirname $0)/logs/${SCRIPT_NAME}.log") 2> >(tee -a "$(dirname $0)/logs/${SCRIPT_NAME}.log" >&2)
Expand All @@ -15,17 +16,17 @@ cd "$(dirname "${BASH_SOURCE[0]}")"

CMD=()

# Generate validator private keys
source $REPO/yarn-project/end-to-end/scripts/native-network/generate-aztec-validator-keys.sh $NUM_VALIDATORS

# Generate validator commands
for ((i = 0; i < NUM_VALIDATORS; i++)); do
PORT=$((8081 + i))
P2P_PORT=$((40401 + i))
IDX=$((i + 1))

# These variables should be set in public networks if we have funded validators already. Leave empty for test environments.
ADDRESS_VAR="ADDRESS_${IDX}"
PRIVATE_KEY_VAR="VALIDATOR_PRIVATE_KEY_${IDX}"
ADDRESS="${!ADDRESS_VAR:-}"
VALIDATOR_PRIVATE_KEY="${!PRIVATE_KEY_VAR:-}"
# Use the arrays generated from generate-aztec-validator-keys.sh
ADDRESS="${VALIDATOR_ADDRESSES_LIST[$i]}"
VALIDATOR_PRIVATE_KEY="${VALIDATOR_PRIVATE_KEYS[$i]}"

CMD+=("./validator.sh $PORT $P2P_PORT $ADDRESS $VALIDATOR_PRIVATE_KEY")
done
Expand Down
Loading