Skip to content

atelet: constrain snapshot files to checkpoint directories - #1426

Open
Du Bin (dubin555) wants to merge 1 commit into
agent-substrate:mainfrom
dubin555:contrib/snapshot-path-validation-public
Open

atelet: constrain snapshot files to checkpoint directories#1426
Du Bin (dubin555) wants to merge 1 commit into
agent-substrate:mainfrom
dubin555:contrib/snapshot-path-validation-public

Conversation

@dubin555

Copy link
Copy Markdown

Summary

  • validate snapshot file names before joining them to checkpoint or restore directories
  • reject invalid external/on-node snapshot manifests at deserialization
  • reject invalid ateom checkpoint results while preserving the existing invalid-checkpoint error classification
  • preserve optional empty results for DATA checkpoints that do not contain runtime snapshot files

Testing

  • go test -race ./cmd/atelet -run 'Test(SnapshotManifestCannotEscapeRestoreDir|CheckpointResponseCannotEscapeCheckpointDir|CheckpointSnapshotFilesAllowsOptionalEmptyResult)$' -count=10
  • go test -race ./cmd/atelet -count=1
  • hack/verify-all.sh

The repository-wide race suite was also run. It passed the changed package and failed only at cmd/atenet/internal/router/TestEnvoyDrainerReachesIPv6OnlyAdmin because this WSL environment resolves localhost to IPv4 while that test listens only on ::1.

@BenTheElder

Copy link
Copy Markdown
Collaborator

cc Zoe Zhao (@zoez7)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants