-
Notifications
You must be signed in to change notification settings - Fork 3
Refactor: block tree and fork choice #51
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
base: master
Are you sure you want to change the base?
Changes from all commits
9a44c3b
48705c1
2597140
ab14d7a
64113fc
06cfe1a
adfb692
8b665f2
c935b3e
186a4a6
193479d
16597ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,8 @@ | ||
| # Genesis Settings | ||
| GENESIS_TIME: 1763468331 | ||
| GENESIS_TIME: 1767089000 | ||
| # Key Settings | ||
| ACTIVE_EPOCH: 18 | ||
| # Validator Settings | ||
| VALIDATOR_COUNT: 1 | ||
| GENESIS_VALIDATORS: | ||
| - "b3183808a14d1875748fd96989441855092ef73c6bf5a7680f03b32d1c12f96ec4659e64fd526f3d975eb168907ee7589946f972" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Hash-Signature Validator Keys Manifest | ||
| # Generated by hash-sig-cli | ||
|
|
||
| key_scheme: SIGTopLevelTargetSumLifetime32Dim64Base8 | ||
| hash_function: Poseidon2 | ||
| encoding: TargetSum | ||
| lifetime: 4294967296 | ||
| log_num_active_epochs: 18 | ||
| num_active_epochs: 262144 | ||
| num_validators: 4 | ||
|
|
||
| validators: | ||
| - index: 0 | ||
| pubkey_hex: 0xb3183808a14d1875748fd96989441855092ef73c6bf5a7680f03b32d1c12f96ec4659e64fd526f3d975eb168907ee7589946f972 | ||
| privkey_file: validator_0_sk.json | ||
|
|
||
| - index: 1 | ||
| pubkey_hex: 0xd89fef7b41821a67c118e26808f48e28d00cbe082a1f88369b8828147f3905656b3b04785a5b26403a0c0a574b4f333bd4d48a03 | ||
| privkey_file: validator_1_sk.json | ||
|
|
||
| - index: 2 | ||
| pubkey_hex: 0xd404bb1091a750710952a64b22240d0013bcc66a64b5b1780b89b120c0dd7d212fa3cb5e42f56e74fcc68950e6b493647524a627 | ||
| privkey_file: validator_2_sk.json | ||
|
|
||
| - index: 3 | ||
| pubkey_hex: 0xb196071b88a6f16d658e512f753be6222e54e91a19e0d676201ac5161cd90e1e40210d36e024f81ae30ee67714092009c20b415c | ||
| privkey_file: validator_3_sk.json |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"root":[2087627763,754406247,1168254309,360212415,1578884007,772417919,1172421982,1682864316],"parameter":[472747929,573156706,1979134263,986355730,1782443694]} |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,10 +13,12 @@ | |||||||||
| #include "types/block_body.hpp" | ||||||||||
| #include "types/block_data.hpp" | ||||||||||
| #include "types/block_header.hpp" | ||||||||||
| #include "types/justification.hpp" | ||||||||||
| #include "types/signed_block_with_attestation.hpp" | ||||||||||
| #include "types/types.hpp" | ||||||||||
|
|
||||||||||
| namespace lean { | ||||||||||
| struct State; | ||||||||||
| } | ||||||||||
| namespace lean::blockchain { | ||||||||||
|
|
||||||||||
| /** | ||||||||||
|
|
@@ -147,7 +149,7 @@ namespace lean::blockchain { | |||||||||
| // -- body -- | ||||||||||
|
|
||||||||||
| /** | ||||||||||
| * Saves provided body of block to block storage | ||||||||||
| * Saves provided body of block to block storage | ||||||||||
| * @returns result of saving | ||||||||||
| */ | ||||||||||
| virtual outcome::result<void> putBlockBody(const BlockHash &block_hash, | ||||||||||
|
|
@@ -167,29 +169,20 @@ namespace lean::blockchain { | |||||||||
| virtual outcome::result<void> removeBlockBody( | ||||||||||
| const BlockHash &block_hash) = 0; | ||||||||||
|
|
||||||||||
| // -- justification -- | ||||||||||
| // -- state -- | ||||||||||
| // TODO: refactoring is needed - make special separated storage for states | ||||||||||
|
||||||||||
| // TODO: refactoring is needed - make special separated storage for states | |
| // Note: state is currently accessed via BlockStorage; if a dedicated state | |
| // storage is introduced in the future, this interface should be updated | |
| // to reflect that separation. |
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.
The genesis time value
1767089000appears to be set to a specific future date. When converted from Unix timestamp, this is approximately December 29, 2025. This seems like it might be a test value that should be updated or parameterized rather than hardcoded in the example genesis configuration.