Skip to content

Copy Edit and Requirements Restructuring#267

Merged
rustyrussell merged 28 commits into
lightning:masterfrom
toadlyBroodle:master
Nov 17, 2017
Merged

Copy Edit and Requirements Restructuring#267
rustyrussell merged 28 commits into
lightning:masterfrom
toadlyBroodle:master

Conversation

@toadlyBroodle
Copy link
Copy Markdown
Collaborator

While reading through first few sections, I noticed a number of grammar, punctuation, and style issues. Also, I found it rather difficult to comprehend the requirements sections due to their lack of structure. So thought I'd take a stab at fixing these things. So far, I've gone through sections 00, 01, and 02 copy-editing for correctness, clarity, conciseness, and consistency.

If this is desirable, I can continue on with the remaining sections?

Thanks,
Landon

…tyle

Edit 00-introduction copy for clarity (minor rephrasing, punctuation),
correctness (grammar, capitalization, punctuation),
consision (minimizing wordiness, redundancy),
and consistency (document style, e.g. 1 space between sentences,
capitalization of headers, etc.)
    Edit 01-messaging copy for clarity (minor rephrasing, punctuation),
    correctness (grammar, capitalization, punctuation),
    consision (minimizing wordiness, redundancy),
    and consistency (document style, e.g. 1 space between sentences,
    capitalization of headers, etc.)
Requirements were difficult to follow in existing sentence form, so I reordered them into hopefully more intuitive groups of unordered lists.
Copy link
Copy Markdown
Collaborator

@rustyrussell rustyrussell left a comment

Choose a reason for hiding this comment

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

Minor comments, I think the last one is the only significant change.

Thanks, though, this is great!

Comment thread 01-messaging.md Outdated
This semantic allows future incompatible changes, or backward
compatible changes. Bits should generally be assigned in pairs, so
This semantic allows future incompatible changes and/or backward
compatible changes. Bits should generally be assigned in pairs, so
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.

How about:

This semantic allows both future incompatible changes and future backward compatible changes.

ie. odd bits->cool if you don't understand, even bits->error if you don't understand.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Sounds good.

Comment thread 01-messaging.md
- MUST ignore the received message.
- otherwise type is even
- MUST fail the channels.

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.

I prefer to separate sending and receiving requirements. As an implementer, you implement one of them at a time.

So, when implementing "receive_foo" you look through the "A node receiving foo..." (and, for c-lightning, we include and check quotes from the spec, making it especially powerful).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Alright, I can go through and group requirements according to sender/receiver for sure.

Implement changes requested by @rustyrussell: wording change, structure requirements according to whether nodes are sending or receiving;
Correct grammar, punctuation, capitalization, and style for correctness, concision, clarity, comprehension, and consistency;
…grammar

Implement changes requested by @rustyrussell: wording change, structure requirements according to whether nodes are sending or receiving;
Correct grammar, punctuation, capitalization, and style for correctness, concision, clarity, comprehension, and consistency;
@toadlyBroodle
Copy link
Copy Markdown
Collaborator Author

toadlyBroodle commented Nov 10, 2017

Ok, I should be pretty much done going over BOLT 0 and BOLT 1 now. I've included a temporary stylesheet/checklist that I've been using for copy editing. Thought others may find it useful for reference.
For the remaining BOLTs, should I keep adding commits here, or start new pull requests?

Done first pass copy edit, up to line 279 of BOLT 2, according to .copy-edit-stylesheet-checklist.md guidelines;
Done first pass copy edit, up to line 576 of BOLT 2, according to .copy-edit-stylesheet-checklist.md guidelines;
fix stylesheet formatting; add passive voice item to stylesheet checklist; apply passive voice change to BOLT 1;
add stylesheet item: prefer typed, not written numbers;
updated BOLT 0, 1 to reflect change;
copy edit BOLT 2 up to line 674;
BOLT 1: minor list formatting fix;
BOLT 2: copy edit up to line 955;
complete first pass copy edit, following .copy-edit-stylesheed-checklist guidelines;
Copy link
Copy Markdown
Collaborator

@rustyrussell rustyrussell left a comment

Choose a reason for hiding this comment

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

Wow. This is so awesome.

Your cleanups made me realize a couple of flawed requirements (ie. "MUST check", but I'm happy to patch those myself after this is merged) so that this is a pure "reformat and tidy" patchset.

That leaves only a couple of minor things I found. If you want to resolve those, I can rebase and apply!

Comment thread .copy-edit-stylesheet-checklist.md Outdated
- SHOULD do this.
- otherwise:
- MUST do this,
- and MUST NOT do this.
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.

Shouldn't "- and MUST NOT do this" be indented less, to line up with the above? I think you only want more indent after a "if" or "otherwise".

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.

I see you used this with a "but MUST NOT" in BOLT 1. See comments there.

Copy link
Copy Markdown
Collaborator Author

@toadlyBroodle toadlyBroodle Nov 15, 2017

Choose a reason for hiding this comment

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

ok I've simplified the structure to reflect this.

Comment thread .copy-edit-stylesheet-checklist.md Outdated
- consistent use of _emphasis_, **strong**, `code`, CAPS, 'quotes'
- single line separators between paragraphs and page elements
- type numbers (e.g. '1', '1s') rather than write them (e.g. 'one', 'ones')
- exception: 'non-zero'
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.

Interesting, I was taught small numbers are as words, large or enumerated as digits. So I would say "between two peers" but "version 0". But this is simpler, I guess.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, exactly right, generally small numbers are written out, however, it's largely a stylistic choice depending upon the publication. My thought was due to the many instances of written mathematical statements, this would help to avoid any potential confusion (e.g. "the old one must be equal to 1"). But this does look funny in a non-mathematical sentence.

So how about this: type references to actual digits (e.g. "the number 1"), otherwise write out small amounts (e.g. "there is one instance of the number 2", "there are two number 1s").

Comment thread 01-messaging.md
- MUST truncate `len` to the remainder of the packet (if it's larger).
- if the string is composed solely of printable ASCII characters (For reference: the printable character set includes byte values 32 through 127, inclusive):
- SHOULD only print out `data` verbatim.

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.

This final case has been inverted (though the original was confusing):

  • if data is not composed solely of printable ASCII characters (For reference: the printable character set includes byte values 32 through 127, inclusive):
    • SHOULD NOT print out data verbatim.

Comment thread 01-messaging.md Outdated
- SHOULD include the raw, hex-encoded transaction in reply to a `funding_created`, `funding_signed`, `closing_signed`, or `commitment_signed` message.
- when `channel_id` is 0:
- MUST fail all channels,
- and MUST close the connection.
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.

Could unindent and remove the "and "?

Comment thread 01-messaging.md
- SHOULD set `ignored` to 0s,
- but MUST NOT set `ignored` to sensitive data such as secrets or portions of initialized
memory.

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.

Ah, I see how you used an extra indent level here to join them. This could go either way; treat them as independent requirements, or, as here, structurally note that the second is a specialization of the first.

Copy link
Copy Markdown
Collaborator Author

@toadlyBroodle toadlyBroodle Nov 15, 2017

Choose a reason for hiding this comment

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

I think you're right, it's simpler to remove the extra indent altogether, except for true sub-items.

Comment thread 02-peer-protocol.md Outdated
A receiving node:
- MUST check that `id` corresponds to an HTLC in its current commitment transaction,
- and MUST fail the channel if it does not.
- MUST check that the `payment_preimage` value in `update_fulfill_htlc`
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.

Again, that's my bad "MUST CHECK" pattern :(

  • if the id does not correspond to an HTLC in its current commitment transaction:
    • MUST fail the channel

Comment thread 02-peer-protocol.md Outdated
- and MUST fail the channel if it does not.
- MUST check that the `payment_preimage` value in `update_fulfill_htlc`
SHA256 hashes to the corresponding HTLC `payment_hash`,
- and MUST fail the channel if it does not.
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.

Again with the MUST check... checking isn't actionable.

Comment thread 02-peer-protocol.md Outdated
- MUST fail the channel.
- MAY check the `sha256_of_onion` in `update_fail_malformed_htlc`,
- and if it does not match the onion it sent:
- MAY retry or choose an alternate error response.
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.

Again, me with the "must check" nonsense :(

Comment thread 02-peer-protocol.md
A node which sends `update_fulfill_htlc` before the sender is also
committed to the HTLC risks losing funds.
A node which sends `update_fulfill_htlc`, before the sender, is also
committed to the HTLC and risks losing funds.
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.

"A node that" perhaps here too?

Comment thread 02-peer-protocol.md Outdated
previous commitment transaction, MUST set `next_per_commitment_point` to the values for its next commitment transaction.
A receiving node:
- MUST check that `per_commitment_secret` generates the previous `per_commitment_point`,
- and MUST fail the channel if it does not.
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.

Again with the MUST check...

update stylesheet to reflect appropriate structure of Requirement sub-items and format of digits, numerations, and quantities;
copy edit BOLTs 0,1,2 to adhere to these changes;
@rustyrussell
Copy link
Copy Markdown
Collaborator

FWIW, in future, merges are best done right at the end (in fact, I prefer rebasing).

I'm going to merge this now, simply because it's going to keep getting harder, and I'm going to do so without cleaning up the commits, because otherwise it'd really become almost one big commit.

@rustyrussell rustyrussell merged commit fd560bb into lightning:master Nov 17, 2017
@toadlyBroodle
Copy link
Copy Markdown
Collaborator Author

Ok, duly noted. Thanks for merging :D

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