Skip to content

attest: Compute default for ENCODED_* from EPOCH, simpler NO_SIGN#54

Open
hodlinator wants to merge 3 commits into
bitcoin-core:mainfrom
hodlinator:2026/06/attest_defaults_no_sign
Open

attest: Compute default for ENCODED_* from EPOCH, simpler NO_SIGN#54
hodlinator wants to merge 3 commits into
bitcoin-core:mainfrom
hodlinator:2026/06/attest_defaults_no_sign

Conversation

@hodlinator

Copy link
Copy Markdown

Improves ergonomics of the asmap-attest script:

  • Document required environment variables in help text
  • Drop the requirement for ENCODED_* env vars as their default locations can be computed based off EPOCH now that the script and files (often) reside in the same repo.
  • Drop requirement for SIGNER if NO_SIGN is set and only output SHA256SUMS in that case. (More subjective value than other commits).

Inspired by discussion at #50 (comment)

Also drop empty newline after help text since at least in bash it appears we get an additional empty one anyway.
In this case we just output the SHA256SUMS to the console.

@jurraca jurraca left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK on the SIGNER/NO_SIGN change (103a6e5) but the ENCODED_* default paths change have tradeoffs that imo are problematic:

  • the point of attestation is not to rely on the files here, but to provide an attestation that the user generated themselves, so that we can compare the attestations to the files in the tree. If the defaults are used, the user is attesting to what's already there. We want the user to provide their own encoded files, showing that they got a final result, and encoded it, and attested to those files.
  • Ideally the user could provide the ASMAP_TXT as currently, and call out to the bitcoin/contrib/asmap/asmap-tool.py to encode the files on the fly, and generate the attestation from there. This is maybe a better approach, though it complicates the script a bit.
  • On attesting to a new run, the default file paths do not exist, so they are required unless the files already exist.
$ env NO_SIGN=1 ASMAP_TXT=../kartograf/out/1780588800/final_result.txt EPOCH=1780588800 ./asmap-attest

ERR: The specified ENCODED_FILLED does not exist or is not a regular file:

    '2026/1780588800_asmap.dat'

Comment thread asmap-attest
diff -u "$sha256sums_file" "$temp_sha256sums" || true
if [ -z "$SIGNER" ]; then
echo "Computed SHA256SUMS at $temp_sha256sums:"
cat $temp_sha256sums

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should rm -rf $temp_sha256sums here too

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