Skip to content

Fix and enforce BIP 2 & 3 field ordering #1893

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bip-0077.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
Author: Dan Gould <[email protected]>
Yuval Kogman <[email protected]>
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/[email protected]/#t
https://gnusha.org/pi/bitcoindev/[email protected]/#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/[email protected]/#t
https://gnusha.org/pi/bitcoindev/[email protected]/#t
Requires: 21, 78, 173, 174
```

Expand Down
2 changes: 1 addition & 1 deletion bip-0078.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
Layer: Applications
Title: A Simple Payjoin Proposal
Author: Nicolas Dorier <[email protected]>
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==
Expand Down
4 changes: 2 additions & 2 deletions bip-0326.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
Layer: Applications
Title: Anti-fee-sniping in taproot transactions
Author: Chris Belcher <[email protected]>
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
Expand Down
4 changes: 2 additions & 2 deletions bip-0327.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
Author: Jonas Nick <[email protected]>
Tim Ruffing <[email protected]>
Elliott Jin <[email protected]>
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 ==
Expand Down
2 changes: 1 addition & 1 deletion bip-0340.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
2 changes: 1 addition & 1 deletion bip-0341.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -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==
Expand Down
2 changes: 1 addition & 1 deletion bip-0342.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -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==
Expand Down
2 changes: 1 addition & 1 deletion bip-0350.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -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==
Expand Down
2 changes: 1 addition & 1 deletion bip-0374.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
31 changes: 30 additions & 1 deletion scripts/buildtable.pl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,30 @@
'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,
Expand Down Expand Up @@ -114,7 +138,7 @@
}
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>$]);
Expand Down Expand Up @@ -182,13 +206,18 @@
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};
}
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} . "\"";
Expand Down