-
Notifications
You must be signed in to change notification settings - Fork 1k
Update documentation using deterministic generation #8557
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
Merged
ShahanaFarooqui
merged 31 commits into
ElementsProject:master
from
rustyrussell:guilt/fix-doc-gen
Jul 14, 2026
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
6d13e5a
lightningd: cancel watching original funding when we switch to the ne…
rustyrussell 5818634
common: add randbytes() wrapper to override cryptographic entropy: $C…
rustyrussell 572818a
global: replace randombytes_buf() with randbytes() wrapper.
rustyrussell 81e7632
common: seed deterministic RNG from basename of argv0, not full path
ShahanaFarooqui 50858b5
common: don't consume deterministic randbytes stream for trace ids
ShahanaFarooqui d041c53
common: don't trigger siphash_seed() init from span hashing either.
ShahanaFarooqui 8ac0202
autogenerate-rpc-examples.py: disable entropy for generation.
rustyrussell 7770183
autogenerate-rpc-examples.py: remove example mangling.
rustyrussell 702793d
autogenerate-rpc-examples.py: remove unused vars
rustyrussell 5d84aee
tests/autogenerate-rpc-examples.py: always use largest UTXO for fundc…
rustyrussell e588bc6
autogenerate-rpc-examples.py: canned blocks.
rustyrussell 662758c
autogenerate-rpc-examples.py: ensure blockheights are consistent.
rustyrussell 7dfa7fe
autogenerate-rpc-examples.py: use fixed port numbers.
rustyrussell 0a79489
autogenerate-rpc-examples.py: more refinement.
rustyrussell 8691453
autogenerate-rpc-examples.py: more block generation and synchronization.
rustyrussell a13bef4
autogenerate-rpc-examples.py: rewrite problematic examples.
rustyrussell 9391549
autogenerate-rpc-examples.py: parameterized base port and cln next ve…
ShahanaFarooqui fefc06a
autogenerate-rpc-examples.py: added 17 new RPC to ignore list
ShahanaFarooqui 21fcdf6
autogenerate-rpc-examples.py: added wait functions like wait_for_htlc…
ShahanaFarooqui 89db2fc
autogenerate-rpc-examples.py: added feature to be able to rewrite the…
ShahanaFarooqui 5ef0397
autogenerate-rpc-examples.py: fixed recover examples via `lightning-h…
ShahanaFarooqui 8f6ccf9
autogenerate-rpc-examples.py: pin the full sorted UTXO set for multiw…
ShahanaFarooqui f27acc2
autogenerate-rpc-examples.py: added more rewrite for other RPCs
ShahanaFarooqui 1cab669
autogenerate-rpc-examples.py: added sorting for some list example to …
ShahanaFarooqui 15819ed
autogenerate-rpc-examples: sanitize plugin paths in plugin examples
ShahanaFarooqui b7481bc
tests: use bitcoind.conf_file instead of hardcoded bitcoin.conf in Ra…
ShahanaFarooqui 1dc4821
doc: generate all examples with newchain
ShahanaFarooqui b4feb42
make: Pinning PATH in doc scripts so generation always uses the tree'…
ShahanaFarooqui 7f155d4
make: Fix repeat-dpc-examples script
ShahanaFarooqui bc63b8c
CI: re-enable docs examples checks.
rustyrussell 00dc521
CI: Add debug and upload artifacts on failure
ShahanaFarooqui File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ | |
| #include <common/utils.h> | ||
| #include <sodium/randombytes.h> | ||
| #include <stdlib.h> | ||
| #include <string.h> | ||
| #include <unistd.h> | ||
|
|
||
| static bool used = false; | ||
|
|
@@ -48,15 +49,23 @@ void randbytes_(void *bytes, size_t num_bytes, u64 *offset) | |
| } | ||
|
|
||
| /* We want different seeds for each plugin (hence argv0), and for each | ||
| * lightmingd instance, (hence seed from environment) */ | ||
| * lightningd instance, (hence seed from environment) */ | ||
| void dev_override_randbytes(const char *argv0, long int seed) | ||
| { | ||
| struct siphash_seed hashseed; | ||
| const char *base; | ||
| assert(!used); | ||
|
|
||
| /* Hash only the basename: binaries still get distinct seeds, but | ||
| * the stream no longer depends on the checkout path. Plugins and | ||
| * subdaemons are exec'd with absolute paths: hash only the basename, | ||
| * so the stream doesn't depend on where the source tree lives */ | ||
|
Comment on lines
+59
to
+62
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: the comment says "hash only the basename" twice (lines 59 and 61–62 restate it), and lines 60/62 are indented one space short of the block ( |
||
| base = strrchr(argv0, '/'); | ||
| base = base ? base + 1 : argv0; | ||
|
|
||
| hashseed.u.u64[0] = seed; | ||
| hashseed.u.u64[1] = 0; | ||
|
|
||
| dev_seed = siphash24(&hashseed, argv0, strlen(argv0)); | ||
| dev_seed = siphash24(&hashseed, base, strlen(base)); | ||
| assert(randbytes_overridden()); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to remove this debug scaffolding.