From b228a2e77d60be056270c36eae41a0d9e4066435 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 29 Nov 2016 12:58:13 +1030 Subject: [PATCH] BOLT 2: remove attempts to align signatures. They're really a blob of bytes, and we weren't aligning them correctly in two cases anyway. This gets rid of gratuitous padding, too. Signed-off-by: Rusty Russell --- 02-peer-protocol.md | 3 +-- tools/extract-formats.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/02-peer-protocol.md b/02-peer-protocol.md index 3d5bda7..c2dd6a9 100644 --- a/02-peer-protocol.md +++ b/02-peer-protocol.md @@ -198,7 +198,6 @@ signature, it will broadcast the funding transaction. * [8:temporary-channel-id] * [32:txid] * [1:output-index] - * [1:pad] * [64:signature] #### Requirements @@ -735,7 +734,7 @@ The description of key derivation is in [BOLT #3](03-transactions.md#key-derivat * [8:channel-id] * [32:per-commitment-secret] * [33:next-per-commitment-point] - * [3:padding] + * [1:padding] * [2:num-htlc-timeouts] * [num-htlc-timeouts*64:htlc-timeout-signature] diff --git a/tools/extract-formats.py b/tools/extract-formats.py index 75fe8f2..cd0d7ff 100755 --- a/tools/extract-formats.py +++ b/tools/extract-formats.py @@ -15,7 +15,7 @@ def guess_alignment(message,name,sizestr): # - channel-id is size 8, but has alignment 4. # - node_announcement.ipv6 has size 16, but alignment 4 (to align IPv4 addr). # - node_announcement.alias is a string, so alignment 1 - # - signatures have alignment 4, because why not. + # - signatures have no alignment requirement. if match.group('name').startswith('pad'): return 1 @@ -29,7 +29,7 @@ def guess_alignment(message,name,sizestr): return 1 if 'signature' in match.group('name'): - return 4 + return 1 # Size can be variable. try: