1
0
mirror of https://github.com/bitcoin/bips.git synced 2025-08-18 13:26:23 +00:00

Merge branch 'nothingmuch-field-ordering-pr'

* nothingmuch-field-ordering-pr:
  CI: Enforce BIP 2 & 3 field ordering requirements
  scripted-diff: fix BIP 2 field order violations
This commit is contained in:
Jon Atack 2025-07-20 14:29:41 -06:00
commit 0f8a2269c2
10 changed files with 43 additions and 14 deletions

View File

@ -5,13 +5,13 @@
Author: Dan Gould <d@ngould.dev>
Yuval Kogman <nothingmuch@woobling.org>
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0077
Post-History: https://github.com/bitcoin/bips/pull/1483
https://gnusha.org/pi/bitcoindev/7B11AE34-27A7-46ED-95BF-66CA13BA26F3@ngould.dev/#t
https://gnusha.org/pi/bitcoindev/3C0A6E4C-444E-4E75-829C-1A21D8EE40E0@ngould.dev/#t
Status: Draft
Type: Standards Track
Created: 2023-08-08
License: BSD-2-Clause
Post-History: https://github.com/bitcoin/bips/pull/1483
https://gnusha.org/pi/bitcoindev/7B11AE34-27A7-46ED-95BF-66CA13BA26F3@ngould.dev/#t
https://gnusha.org/pi/bitcoindev/3C0A6E4C-444E-4E75-829C-1A21D8EE40E0@ngould.dev/#t
Requires: 21, 78, 173, 174
```

View File

@ -3,13 +3,13 @@
Layer: Applications
Title: A Simple Payjoin Proposal
Author: Nicolas Dorier <nicolas.dorier@gmail.com>
Replaces: 79
Comments-Summary: No comments yet.
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0078
Status: Draft
Type: Standards Track
Created: 2019-05-01
License: BSD-2-Clause
Replaces: 79
</pre>
==Introduction==

View File

@ -3,10 +3,10 @@
Layer: Applications
Title: Anti-fee-sniping in taproot transactions
Author: Chris Belcher <belcher@riseup.net>
Status: Draft
Type: Informational
Comments-Summary: No comments yet.
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0326
Status: Draft
Type: Informational
Created: 2021-06-10
License: CC0-1.0
Post-History: 2021-6-10: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-June/019048.html

View File

@ -4,13 +4,13 @@
Author: Jonas Nick <jonasd.nick@gmail.com>
Tim Ruffing <crypto@timruffing.de>
Elliott Jin <elliott.jin@gmail.com>
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0327
Status: Active
License: BSD-3-Clause
Type: Informational
Created: 2022-03-22
License: BSD-3-Clause
Post-History: 2022-04-05: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-April/020198.html [bitcoin-dev] MuSig2 BIP
2022-10-11: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-October/021000.html [bitcoin-dev] MuSig2 BIP
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0327
</pre>
== Introduction ==

View File

@ -8,11 +8,11 @@
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0340
Status: Final
Type: Standards Track
Created: 2020-01-19
License: BSD-2-Clause
License-Code: BSD-2-Clause
MIT
CC0-1.0
Created: 2020-01-19
Post-History: 2018-07-06: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-July/016203.html [bitcoin-dev] Schnorr signatures BIP
</pre>

View File

@ -11,9 +11,9 @@
Type: Standards Track
Created: 2020-01-19
License: BSD-3-Clause
Requires: 340
Post-History: 2019-05-06: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2019-May/016914.html [bitcoin-dev] Taproot proposal
2019-10-09: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2019-October/017378.html [bitcoin-dev] Taproot updates
Requires: 340
</pre>
==Introduction==

View File

@ -11,8 +11,8 @@
Type: Standards Track
Created: 2020-01-19
License: BSD-3-Clause
Requires: 340, 341
Post-History: 2019-05-06: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2019-May/016914.html [bitcoin-dev] Taproot proposal
Requires: 340, 341
</pre>
==Introduction==

View File

@ -9,8 +9,8 @@
Type: Standards Track
Created: 2020-12-16
License: BSD-2-Clause
Replaces: 173
Post-History: 2021-01-05: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-January/018338.html [bitcoin-dev] Bech32m BIP: new checksum, and usage for segwit address
Replaces: 173
</pre>
==Introduction==

View File

@ -8,8 +8,8 @@
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0374
Status: Draft
Type: Standards Track
License: BSD-2-Clause
Created: 2024-12-26
License: BSD-2-Clause
Post-History: https://gist.github.com/andrewtoth/df97c3260cc8d12f09d3855ee61322ea
https://groups.google.com/g/bitcoindev/c/MezoKV5md7s
</pre>

View File

@ -37,6 +37,30 @@ my %MiscField = (
'Requires' => undef,
'Superseded-By' => undef,
);
my @FieldOrder = qw(
BIP
Layer
Title
Author
Authors
Editor
Deputies
Discussions-To
Comments-Summary
Comments-URI
Status
Type
Created
License
License-Code
Discussion
Post-History
Version
Requires
Replaces
Proposed-Replacement
Superseded-By
);
my %ValidLayer = (
'Consensus (soft fork)' => undef,
@ -114,7 +138,7 @@ while (++$bipnum <= $topbip) {
}
my %found;
my ($title, $author, $status, $type, $layer);
my ($field, $val);
my ($field, $val, @field_order);
while (<$F>) {
last if ($is_markdown && m[^```$]);
last if (!$is_markdown && m[^</pre>$]);
@ -182,6 +206,7 @@ while (++$bipnum <= $topbip) {
die "Unknown field $field in $fn";
}
++$found{$field};
push @field_order, $field unless @field_order and $field_order[-1] eq $field;
}
if (not $found{License}) {
die "Missing License in $fn" unless exists $TolerateMissingLicense{$bipnum};
@ -189,6 +214,10 @@ while (++$bipnum <= $topbip) {
for my $field (keys %RequiredFields) {
die "Missing $field in $fn" unless $found{$field};
}
my @expected_field_order = grep { exists $found{$_} } @FieldOrder;
if ("@expected_field_order" ne "@field_order") {
die "Field order is incorrect in $fn, should be:\n\t" . join(", ", @expected_field_order) . "\nbut contains:\n\t" . join(", ", @field_order);
}
print "|-";
if (defined $ValidStatus{$status}) {
print " style=\"" . $ValidStatus{$status} . "\"";