Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
141 changes: 141 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,147 @@ jobs:
cd ./my-awesome-avs/
devkit avs transport verify

- name: Start local Docker registry
run: |
docker run -d --name registry -p 5001:5000 registry:2
echo "Waiting for registry to be ready..."
for i in {1..10}; do
if nc -z localhost 5001; then
echo "✅ Registry is ready"
break
fi
echo "Waiting for registry... ($i/10)"
sleep 2
done

- name: Build and push AVS image to local registry
run: |
cd ./my-awesome-avs/
# Build the AVS image
docker build -t localhost:5001/my-awesome-avs:latest .
# Push to local registry
docker push localhost:5001/my-awesome-avs:latest
echo "✅ AVS image pushed to local registry"

- name: Update config for local registry
run: |
cd ./my-awesome-avs/
# Update the artifact registry in context to use local registry
yq eval '.context.artifact.registry = "localhost:5001"' -i config/contexts/devnet.yaml
echo "Updated registry configuration:"
yq eval '.context.artifact' config/contexts/devnet.yaml
Comment thread
fuekiinc marked this conversation as resolved.
Outdated

- name: Publish AVS release
run: |
cd ./my-awesome-avs/
# Get current timestamp + 1 hour for upgrade-by-time
UPGRADE_BY_TIME=$(($(date +%s) + 3600))
echo "Publishing release with upgrade-by-time: $UPGRADE_BY_TIME ($(date -d @$UPGRADE_BY_TIME))"

# Run the release publish command
devkit avs release publish --upgrade-by-time $UPGRADE_BY_TIME --registry localhost:5001

# Check if the command succeeded
if [ $? -eq 0 ]; then
echo "✅ Release published successfully"
else
echo "❌ Release publish failed"
exit 1
fi

- name: Verify release on ReleaseManager contract
run: |
cd ./my-awesome-avs/

# Get AVS address from context
AVS_ADDRESS=$(yq eval '.context.avs.address' config/contexts/devnet.yaml)
echo "AVS Address: $AVS_ADDRESS"

RELEASE_MANAGER_ADDRESS="0x323A9FcB2De80d04B5C4B0F72ee7799100D32F0F"
echo "ReleaseManager Address: $RELEASE_MANAGER_ADDRESS"

# Query the ReleaseManager contract to verify the release
echo "Querying ReleaseManager for operator set 0..."

# Get the latest version
LATEST_VERSION=$(cast call $RELEASE_MANAGER_ADDRESS \
"latestVersion(address,uint32)" \
$AVS_ADDRESS 0 \
--rpc-url http://localhost:8545)

echo "Latest version for operator set 0: $LATEST_VERSION"

VERSION_DEC=$((LATEST_VERSION))
echo "Latest version (decimal): $VERSION_DEC"

if [ $VERSION_DEC -eq 0 ]; then
echo "❌ No release found on ReleaseManager"
exit 1
fi

# Get release details
RELEASE_DATA=$(cast call $RELEASE_MANAGER_ADDRESS \
"getRelease(address,uint32,uint256)" \
$AVS_ADDRESS 0 $((VERSION_DEC - 1)) \
--rpc-url http://localhost:8545)

echo "Release data retrieved: $RELEASE_DATA"

if [ -z "$RELEASE_DATA" ] || [ "$RELEASE_DATA" = "0x" ]; then
echo "❌ Release data is empty"
exit 1
fi

echo "✅ Release verified on ReleaseManager contract"

- name: Test multiple operator sets release
Comment thread
fuekiinc marked this conversation as resolved.
Outdated
run: |
cd ./my-awesome-avs/

# Create another operator set
echo "Creating operator set 1..."
DEPLOYER_KEY=$(yq eval '.context.deployer_private_key' config/contexts/devnet.yaml)
AVS_ADDRESS=$(yq eval '.context.avs.address' config/contexts/devnet.yaml)
ALLOCATION_MANAGER_ADDRESS="0x76f67c84eF6F6cF76ec52b4cEFa28ca7492Bd43a"

# Use cast to create operator set
cast send $ALLOCATION_MANAGER_ADDRESS \
"createOperatorSets(address,(uint32,address[])[])" \
$AVS_ADDRESS "[(1,[])]" \
--private-key $DEPLOYER_KEY \
--rpc-url http://localhost:8545

echo "✅ Operator set 1 created"

# Publish release for multiple operator sets
UPGRADE_BY_TIME=$(($(date +%s) + 7200)) # 2 hours from now

devkit avs release publish --upgrade-by-time $UPGRADE_BY_TIME --registry localhost:5001

# Verify both operator sets have releases
for OPSET in 0 1; do
LATEST_VERSION=$(cast call $RELEASE_MANAGER_ADDRESS \
"latestVersion(address,uint32)" \
$AVS_ADDRESS $OPSET \
--rpc-url http://localhost:8545)

VERSION_DEC=$((LATEST_VERSION))
echo "Operator set $OPSET latest version: $VERSION_DEC"

if [ $VERSION_DEC -eq 0 ]; then
echo "❌ No release found for operator set $OPSET"
exit 1
fi
done

echo "✅ Releases published for multiple operator sets"

- name: Stop local Docker registry
if: always()
Comment thread
fuekiinc marked this conversation as resolved.
Outdated
run: |
docker stop registry || true
docker rm registry || true

- name: Stop devnet
run: |
cd ./my-awesome-avs/
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,36 @@ jobs:
cd ./my-awesome-avs/
devkit avs call -- signature="(uint256,string)" args='(5,"hello")'

- name: Test release publish
run: |
cd ./my-awesome-avs/

CURRENT_VERSION=$(grep -A 1 "artifact:" config/contexts/devnet.yaml | grep "version:" | awk '{print $2}' | tr -d '"')
echo "Current version: ${CURRENT_VERSION:-empty}"

# Calculate upgrade time (10 minutes from now)
if [ "${{ matrix.os }}" = "macos-latest" ]; then
UPGRADE_TIME=$(date -v +10M +%s)
else
UPGRADE_TIME=$(date -d "+10 minutes" +%s)
fi

# Run release publish with explicit registry
echo "Publishing release with upgrade time: $UPGRADE_TIME"
devkit avs release publish --upgrade-by-time $UPGRADE_TIME --registry localhost:5001

# Check that version was updated
NEW_VERSION=$(grep -A 1 "artifact:" config/contexts/devnet.yaml | grep "version:" | awk '{print $2}' | tr -d '"')
echo "New version: $NEW_VERSION"

# Verify version was incremented
if [ "$NEW_VERSION" = "1" ] || [ "$NEW_VERSION" -gt 0 ]; then
echo "✅ Release published successfully, version updated to: $NEW_VERSION"
else
echo "❌ Release publish failed - version not updated"
exit 1
fi

- name: Stop devnet
run: |
cd ./my-awesome-avs/
Expand Down
Loading