Open nayuta-ueno opened 6 years ago
c-lightningはcommitment_signed
を送信した方になるが、再接続時に同じcommitment_signed
を再送してきた。
BOLT仕様に明記されていない動作のように思うが、どうなのだろうか?
commitment_signed
受信によってabort()channel_reestablish
送信
commitment_signed
を再送上記のログ fail_comsig_log.zip
BOLT#02の、一番下が該当すると思われる。
A node:
commitment_signed
message:
update_
messages as previously sent.shutdown
:
shutdown
.該当するのか、よくわからなくなってきた。 c-lightningにissueで確認中。
commitment_signed
は再送とは呼ばない再送を行うと判断した。
commitment numberが不一致の場合の commitment_signed の再送受信には対応したが、再送ができていない。 unilateral closeしてしまっている。
理想型
commitment_signed
1. (disconnect after established)
2. connect
3. exchange `init`
4. exchange `channel_reestablish`
* `next_local_commitment_number`: 1
* `next_remote_revocation_number`: 0
5. `./cli/lightning-cli invoice`
6. [our --> their]`update_add_htlc`
7. [our --> their]`commitment_signed`
8. [their --> our]`revoke_and_ack`
9. [their --> our]`commitment_signed`
10. ★ our node disconnect before processing `commitment_signed`
11. connect
12. exchange `init`
13. exchange `channel_reestablish`
* our node send:
* `next_local_commitment_number`: 1
* `next_remote_revocation_number`: 1
* their send:
* `next_local_commitment_number`: 2
* `next_remote_revocation_number`: 0
14. [their --> our]`commitment_signed`
15. [our-->their]`revoke_and_ack`
16. [their --> our]`update_fulfill_htlc`
17. [their --> our]`commitment_signed`
18. [our-->their]`revoke_and_ack`
19. [our-->their]`commitment_signed`
20. [their --> our]`revoke_and_ack`
commitment_signed
の再送はおこなっているので、closeでよい。commitment_signed
/ revoke_and_ack
交換を4状態に分け、状態2以降であればどちらか片方でもirrevocably committedになっているので再送などを行う。
update_add_htlc
側がcommitment_signed
を送信後revoke_and_ack
返信後commitment_signed
送信後revoke_and_ack
送信後もっと汎用的な見分け方はできないだろうか? P2Pなのにシーケンスに依存しすぎている気がする。
もう1つ。
状態1から元に戻す場合、HTLCのid
をどこに戻して良いのかが簡単に決められそうな感じがしていない。
DBに保存すれば可能なのか? それとも前回の「状態」という考え方を見直す必要があるのか?
525
再接続の要件と実装については再確認すること。