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

Remove laanwj from trusted-keys #27054

Merged
merged 1 commit into from
Feb 16, 2023
Merged

Conversation

laanwj
Copy link
Member

@laanwj laanwj commented Feb 7, 2023

allow-revsig-commits list generated using:

git log --format="%H %ce" --merges 577bd51a4b8de066466a445192c1c653872657e2..master | grep laanwj | cut -c -40 >> allow-revsig-commits

allow-revsig-commits list generated using:

    git log --format="%H %ce" --merges 577bd51..master | grep laanwj | cut -c -40 >> allow-revsig-commits

Tree-SHA512: e665d1f3f6ae45ad435cb2802d49988f5133d695b145aa2dc65af95c052e562e0afaf585c351a41529985b4229965cf555f7197a44c90ba7daaea7a28975648d
@DrahtBot
Copy link
Contributor

DrahtBot commented Feb 7, 2023

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK Sjors, achow101, fanquake

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #27058 (contrib: Improve verify-commits.py to work with maintainers leaving by achow101)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@ajtowns
Copy link
Contributor

ajtowns commented Feb 7, 2023

allow-revsig-commits list generated using:

git log --format="%H %ce" --merges 577bd51a4b8de066466a445192c1c653872657e2..master | grep laanwj | cut -c -40 >> allow-revsig-commits

Seems to match with:

git log --format="%H %GK" --merges $(cat contrib/verify-commits/trusted-git-root)..master | grep -E " 1E4AED62986CD25D" | cut -c -40

if you prefer querying by key id, rather than committer email. Bit slower though (20s vs 0.2s). The key id matches the signing subkey:

$ gpg --list-key --with-colons 71A3B16735405025D447E8F274810B012346C9A6 |  cut -d: -f1,5,12 | grep 'sub:.*:s'
sub:1E4AED62986CD25D:s

@achow101
Copy link
Member

achow101 commented Feb 7, 2023

I don't think adding your merged commits to allow-revsig-commits actually allows them. Once verify-commits gets to those commits, since they are signed with a key no longer in trusted-keys, it will fail. Currently the only solution is to update trusted-git-root, although I'm working on a longer term solution that lets us set a "valid until" for the trusted keys.

@Sjors
Copy link
Member

Sjors commented Feb 7, 2023

tACK aafa5e9 😢


The behavior of verify-commits is quite confusing, because it is checking out different commits along the way. allow-revsig-commits is loaded in memory at the start so it stays the same throughout. But trusted-keys is loaded via the gpg.sh, and so it does change.

That makes sense because the list of trusted keys changes through time. But it means the newly added hash only have an effect if you call verify-commits with one of those hashes. In that case we check that commit against the current trusted-keys. If on the other hand you start traversing from HEAD~1, it uses the old trusted-keys and won't error.

You can see this difference in behavior by amending this commit to drop one of the hashes. The verify-commits script will fail if you pass it that hash, and succeed if you don't.

It would probably help if it cloned the repo in tmp rather than operate on itself.

Still I think we can merge with these hashes added and improve the script later.

I've checked the commit list in aafa5e9 against the list generated by @ajtowns's incantation. Also checked that this commit was signed by @laanwj.

Note to other testers: the verify-commits.py script can be a bit cryptic when a PGP key has expired. Use git verify-commit on the commit it trips over to see which key is expired and then refresh it (or just refresh all of them).

@achow101
Copy link
Member

achow101 commented Feb 7, 2023

The behavior of verify-commits is quite confusing, because it is checking out different commits along the way. allow-revsig-commits is loaded in memory at the start so it stays the same throughout. But trusted-keys is loaded via the gpg.sh, and so it does change.

It should only be checking out commits in order to do the clean merge check. When it does that, it will always reset itself to the commit given, and thus gpg.sh will use the trusted-keys of that commit. If you disable the clean merge check with --clean-merge 0, then it uses the trusted keys of the current tree and does not modify it at all.

@Sjors
Copy link
Member

Sjors commented Feb 7, 2023

reset itself to the commit given

Unfortunately that commit can't be (an amended) aafa5e9 because that would simply fail. So when testing this PR it reset to the commit before it (that I used as the argument), with the trusted-keys at that time. But trying with --clean-merge 0 makes sense. And then indeed it seems to ignore the hashes in allow-revsig-commits.

So I guess the verification script only "works" if you enable the option(s) that cause it change commits, but either way allow-revsig-commits seems to be ignored.

@maflcko
Copy link
Member

maflcko commented Feb 8, 2023

I think you can just bump the root, like it was done before, see d4b3dc5

@maflcko
Copy link
Member

maflcko commented Feb 8, 2023

In any case, I think this can be merged as is, the intent should be clear here, and any bug fixes or behaviour changes of the script are better handled in a separate pull.

fanquake added a commit that referenced this pull request Feb 15, 2023
…ent laanwj merge

6ada37d verify-commits: Bump trusted git root to after most recent laanwj merge (Andrew Chow)

Pull request description:

  To prepare for the removal of laanwj's key from trusted key (#27054), the trusted git root needs to be newer than the most recent merge commit signed by his key.

  This can be tested by removing the laanwj's key from trusted keys (e.g. by merging with #27054) and running `verify-commits.py` with `--clean-merge 0`: `./contrib/verify-commits/verify-commits.py --clean-merge 0 HEAD~`. (`--clean-merge 0` disables the clean merge check which will checkout some commits, which results in the `trusted-keys` used in checking of subsequent commits to be different than expected).

ACKs for top commit:
  fanquake:
    ACK 6ada37d
  hebasto:
    ACK 6ada37d, I've verified the history of laanwj's merge commits.

Tree-SHA512: 55cafeddd54aa2b62d7b7cd41c542f4fd974b322a0405de546600d88658575714ebc893b087eb31f28c205559a7b213f88d9038de431271fca00be866610df74
Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

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

left a comment, if you retouch

2d0bdb2089644f5904629413423cdc897911b081
50c502f54abd9eb15c8ddca013f0fdfae3d132a9
c840ab0231bc29057172179f005001c9ab299554
aab5e48d422d396aec09bd6389de68613b19def5
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this can be dropped after commit 2b0cd76

Probably the whole file can be dropped, but this can be done either here or in a follow-up.

Copy link
Member

Choose a reason for hiding this comment

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

Lets sort this out in a followup, like #27058.

@achow101
Copy link
Member

ACK aafa5e9

Copy link
Member

@fanquake fanquake left a comment

Choose a reason for hiding this comment

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

ACK aafa5e9

@fanquake fanquake merged commit cbf511b into bitcoin:master Feb 16, 2023
@bitcoin bitcoin locked and limited conversation to collaborators Feb 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants