Skip to content

Documentation Part V: channeld#2132

Merged
niftynei merged 10 commits intoElementsProject:masterfrom
rustyrussell:guilt/docs
Dec 12, 2018
Merged

Documentation Part V: channeld#2132
niftynei merged 10 commits intoElementsProject:masterfrom
rustyrussell:guilt/docs

Conversation

@rustyrussell
Copy link
Copy Markdown
Contributor

No description provided.

bool am_funder)
{
/* This is an event loop of its own. That's generally considered poor
* for, but we use it in a very limited way. */
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.

spelling: meant 'poor form' ?

/*~ This verbosity is not only useful for our own testing, but
* a courtesy to other implementaters whose brains may be so
* twisted by coding in Go, Scala and Rust that they can no
* longer read C code. */
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.

😆

struct crypto_state cs;
struct pubkey next_per_commit[NUM_SIDES];

/* Constriants on a channel they open. */
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.

Spelling: Constriants -> Constraints

status_debug("aborted opening negotiation: %s", why);
/*~ The "billboard" (exposed as "status" in the JSON listpeers RPC
* call) is a transient per-channel area which indicates important
* information about what is happening. It has a "permenant" area for
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.

Spelling: permenant -> permanent

@conscott
Copy link
Copy Markdown
Collaborator

conscott commented Dec 4, 2018

Loving more docs! Thank you.

Copy link
Copy Markdown
Collaborator

@niftynei niftynei left a comment

Choose a reason for hiding this comment

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

few typing/typo nits. these notes would have been nice to have last week when doing the work for the private channel flag 👍


/* Global state structure. This is only for the one specific peer and channel */
struct state {
/* Cryptographic state needed to exchange messages with the peer */
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.

Assuming this is the purview of BOLT #8, would it be useful to reference it?

}

/* For negotiation failures: we tell them it's their fault. */
/*~ For negotiation failures: we tell them the parameter we didn't like. */
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.

👍 for diplomacy

/* We ask the HSM to sign their commitment transaction for us: it knows
* our funding key, it just needs the remote funding key to create the
* witness script. It also needs the amount of the funding output,
* as segwit signatures commit to that as well, even thought it doesn't
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.

thought -> though

peer_billboard(false,
"Funding channel: create first tx, now waiting for their signature");

/* Now we they send us their signature for that first commitment
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.

remove we ?

* soon) that we put it into the first version of the protocol
* because it would be painful to add in later.
*
* My logic was seemed sound: we treat new connections as an
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.

was seemed -> seemed ?

/* If they wanted to send an msg, do so before we waste time
* doing work. If it's a global error, we'll close
* immediately. */
/*~ If they wanted to send an msg, do so before we waste time doing
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.

an msg -> a msg

…per BOLT 2.

And group struct state fields together into some kind of logical order.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…lation.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…l error.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This existed previously, but code perturbations seem to have revealed it
now: test_bad_opening reports a leak.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reported-by: Conor Scott @connscott
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reported-by: @niftynei
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Copy link
Copy Markdown
Contributor

@wythe wythe left a comment

Choose a reason for hiding this comment

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

Very good. I think I learned something.

struct basepoints our_points;
struct pubkey our_funding_pubkey;

/* hsmd gives is our first per-commitment point, and peer tells us
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

gives is -> gives us

* protocol has a "channel_id" field in all non-gossip messages
* so it's possible. Our one-process-one-channel mechanism
* keeps things simple: if we wanted to change this, we would
* probably be best with another daemon to de-multipliex them;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

multipliex -> multiplex

Reported-by: @wythe
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@niftynei
Copy link
Copy Markdown
Collaborator

ACK a2cf452

@niftynei niftynei merged commit 9b9f9e4 into ElementsProject:master Dec 12, 2018
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.

4 participants