Skip to content

Commit 70d24e5

Browse files
committed
Fix packet harness Paper provenance
Pass the pinned Paper version, channel, and build through packet runs so strengthened manifest validation accepts only the intended runtime.
1 parent 8d3431c commit 70d24e5

1 file changed

Lines changed: 23 additions & 4 deletions

File tree

.github/workflows/phase2-packet-capture.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ jobs:
6363
runs-on: ubuntu-latest
6464
timeout-minutes: 100
6565
env:
66+
CAMPAIGN_PAPER_VERSION: "26.1.2"
67+
CAMPAIGN_PAPER_BUILD_ID: "74"
68+
CAMPAIGN_PAPER_CHANNEL: STABLE
6669
CAMPAIGN_SCENARIO: ${{ github.event_name == 'workflow_dispatch' && inputs.scenario || contains(github.event.label.name, 'visibility-itemdisplay') && 'visibility-itemdisplay-return' || contains(github.event.label.name, 'visibility-textdisplay') && 'visibility-textdisplay-return' || contains(github.event.label.name, 'visibility') && 'visibility-return' || 'static-spawn' }}
6770
CAMPAIGN_RUNS: ${{ github.event_name == 'workflow_dispatch' && inputs.runs || contains(github.event.label.name, '-formal') && '12' || '4' }}
6871
CAMPAIGN_ITEMS: ${{ github.event_name == 'workflow_dispatch' && inputs.items || contains(github.event.label.name, '-formal') && '4096' || '1024' }}
@@ -114,26 +117,39 @@ jobs:
114117
- name: Build and test the production plugin
115118
run: ./gradlew clean check shadowJar --no-daemon --no-build-cache --rerun-tasks
116119

117-
- name: Download stable Paper 26.1.2
120+
- name: Download pinned stable Paper 26.1.2 build 74
118121
env:
119122
PAPER_USER_AGENT: InteractionVisualizer-Phase2/1.0 (https://github.com/EllanServer/InteractionVisualizer)
123+
PAPER_VERSION: ${{ env.CAMPAIGN_PAPER_VERSION }}
124+
PAPER_BUILD_ID: ${{ env.CAMPAIGN_PAPER_BUILD_ID }}
125+
PAPER_CHANNEL: ${{ env.CAMPAIGN_PAPER_CHANNEL }}
120126
run: |
121127
mkdir -p phase2-dependencies
122128
BUILDS=$(curl --fail --silent --show-error \
123129
-H "User-Agent: $PAPER_USER_AGENT" \
124-
https://fill.papermc.io/v3/projects/paper/versions/26.1.2/builds)
125-
PAPER_URL=$(echo "$BUILDS" | jq -r 'first(.[] | select(.channel == "STABLE") | .downloads."server:default".url) // empty')
126-
test -n "$PAPER_URL"
130+
"https://fill.papermc.io/v3/projects/paper/versions/$PAPER_VERSION/builds")
131+
PAPER_RECORD=$(echo "$BUILDS" | jq -c \
132+
--arg channel "$PAPER_CHANNEL" --argjson build_id "$PAPER_BUILD_ID" \
133+
'first(.[] | select(.channel == $channel and .id == $build_id)) // empty')
134+
test -n "$PAPER_RECORD"
135+
[[ "$(echo "$PAPER_RECORD" | jq -r '.id')" == "$PAPER_BUILD_ID" ]]
136+
[[ "$(echo "$PAPER_RECORD" | jq -r '.channel')" == "$PAPER_CHANNEL" ]]
137+
PAPER_URL=$(echo "$PAPER_RECORD" | jq -r '.downloads."server:default".url')
138+
PAPER_SHA256=$(echo "$PAPER_RECORD" | jq -r '.downloads."server:default".checksums.sha256')
127139
curl --fail --location --show-error \
128140
-H "User-Agent: $PAPER_USER_AGENT" \
129141
--output phase2-dependencies/paper.jar "$PAPER_URL"
142+
echo "$PAPER_SHA256 phase2-dependencies/paper.jar" | sha256sum --check
130143
131144
- name: Prepare immutable protocol client artifact
132145
run: bash tools/perf/prepare-phase2-protocol-client.sh phase2-dependencies/protocol-client
133146

134147
- name: Run restart-isolated packet ABBA campaign
135148
id: packet_campaign
136149
env:
150+
PAPER_VERSION: ${{ env.CAMPAIGN_PAPER_VERSION }}
151+
PAPER_BUILD_ID: ${{ env.CAMPAIGN_PAPER_BUILD_ID }}
152+
PAPER_CHANNEL: ${{ env.CAMPAIGN_PAPER_CHANNEL }}
137153
SCENARIO: ${{ env.CAMPAIGN_SCENARIO }}
138154
RUNS: ${{ env.CAMPAIGN_RUNS }}
139155
ITEMS: ${{ env.CAMPAIGN_ITEMS }}
@@ -189,6 +205,9 @@ jobs:
189205
190206
PHASE2_PLUGIN_JAR="$PLUGIN_JAR" \
191207
PHASE2_PAPER_JAR=phase2-dependencies/paper.jar \
208+
PHASE2_PAPER_VERSION="$PAPER_VERSION" \
209+
PHASE2_PAPER_CHANNEL="$PAPER_CHANNEL" \
210+
PHASE2_PAPER_BUILD_ID="$PAPER_BUILD_ID" \
192211
PHASE2_CLIENT_ROOT=phase2-dependencies/protocol-client \
193212
PHASE2_OUTPUT_ROOT=phase2-results/packet \
194213
PHASE2_RUN_ID="$run_id" \

0 commit comments

Comments
 (0)