Skip to content
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

IF: Savanna #2

Merged
merged 1,811 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1811 commits
Select commit Hold shift + click to select a range
773577b
update deep-mind.log
linh2931 Apr 4, 2024
4066109
GH-2102 Check for validated block to avoid extra processing
heifner Apr 4, 2024
486fed3
make it clear action_mroot_savanna constructed as a std::optional
linh2931 Apr 4, 2024
9411c05
GH-2102 Init processed on reflection
heifner Apr 4, 2024
3465884
Make action_receipt_digests_savanna as const& to parameter to block_s…
linh2931 Apr 4, 2024
0c82e7a
GH-2102 Handle corner case of trx locally applied but not in a block yet
heifner Apr 4, 2024
b9deb58
GH-2102 Only report fork switch on actual fork switch. maybe_switch_f…
heifner Apr 4, 2024
8a7b973
GH-2102 Check for terminate_at_block during apply of fork db blocks
heifner Apr 4, 2024
274e44a
GH-2102 If forked out again then could still be in local state
heifner Apr 4, 2024
93163ec
store action_mroot only for the last block in the process of construc…
linh2931 Apr 4, 2024
2e49794
GH-2102 Allow ctrl-c shutdown during sync of a large number of blocks…
heifner Apr 4, 2024
4c3535f
GH-2102 Fix sync issue with receiving a current block while syncing
heifner Apr 4, 2024
08d0c96
Merge pull request #2362 from AntelopeIO/add_finality_data_in_transit…
linh2931 Apr 4, 2024
112bb69
GH-2102 On startup pending_head forkdb blocks are processed. If asked…
heifner Apr 4, 2024
84098e5
switch variant index of new get_blocks_request_v1
spoonincode Apr 4, 2024
66c7c62
Merge pull request #2381 from AntelopeIO/ship_gbrv1_variant
spoonincode Apr 5, 2024
914f218
GH-2102 Fix comparison in waitForBlock
heifner Apr 5, 2024
5e9af0c
GH-2102 Better error reporting and a bit more tolerance for trxs in b…
heifner Apr 5, 2024
2449830
GH-2102 Add additional logging for applied blocks
heifner Apr 5, 2024
e464aee
Revert "GH-2102 Fix comparison in waitForBlock"
heifner Apr 5, 2024
a74450c
GH-2102 Improve logging during sync
heifner Apr 5, 2024
cafd0b6
GH-2102 Add a large_atomic wrapper around mutex
heifner Apr 5, 2024
302b957
GH-2102 Use large_atomic for if_irreversible_block_id
heifner Apr 5, 2024
be77ca6
GH-2102 No need to recalculate finality digest
heifner Apr 5, 2024
23945ff
GH-2102 Move valid_qc into pending_qc and make thread safe
heifner Apr 5, 2024
ba5006e
GH-2102 Improve test conditions
heifner Apr 5, 2024
9de11ff
GH-2102 Move produced/received block logging into controller so it lo…
heifner Apr 6, 2024
8e98c18
GH-2102 Fix log_applied to not be called during replay
heifner Apr 6, 2024
a9058a1
GH-2102 Add a copyable atomic type
heifner Apr 8, 2024
6d64c27
GH-2102 Integrate qc and vote if possible off the main thread.
heifner Apr 8, 2024
6bd8128
Merge remote-tracking branch 'origin/hotstuff_integration' into GH-21…
heifner Apr 8, 2024
c54fe32
Increment `finalizer_policy`'s `generation`.
greg7mdp Apr 8, 2024
232e95b
Merge pull request #2388 from AntelopeIO/gh_2345
greg7mdp Apr 9, 2024
33210c0
GH-2102 Small cleanup from PR review
heifner Apr 9, 2024
5cc1b87
GH-2102 Move Produced block log into controller_impl commit_block
heifner Apr 9, 2024
f9786e1
Merge pull request #2385 from AntelopeIO/GH-2102-vote-processing
heifner Apr 10, 2024
a3ce90c
Implement finalizer policy change at appropriate time.
greg7mdp Apr 10, 2024
64616c3
Add missing serialization of `proposer_policies`'s timestamp in `base…
greg7mdp Apr 10, 2024
aace335
Disable ship streamer tests until ship is fixed.
heifner Apr 10, 2024
1918009
Send handshake to peer to let it know it is not syncing from us.
heifner Apr 10, 2024
5a3e043
Merge branch 'spring/main' into merge-main-04-10-2024
heifner Apr 10, 2024
7fc69ac
GH-3 Move vote processing off net threads into a dedicated thread pool
heifner Apr 10, 2024
c3a9c95
GH-3 Track num_messages per connection
heifner Apr 11, 2024
8cc9420
Merge pull request #21 from AntelopeIO/disable-ship-tests
heifner Apr 11, 2024
4c5e909
Merge branch 'savanna' into merge-main-04-10-2024
heifner Apr 11, 2024
6b0c4c4
GH-3 Make vote processor thread pool size configurable including disa…
heifner Apr 11, 2024
fba5561
GH-3 Fix issue with not re-locking after unlock
heifner Apr 11, 2024
1dcf7c1
GH-3 Shutdown nodeos on vote thread pool exception
heifner Apr 11, 2024
76a79ab
Merge branch 'savanna' into net-sync-peer-fix
heifner Apr 11, 2024
f5967c0
Merge pull request #22 from AntelopeIO/net-sync-peer-fix
heifner Apr 11, 2024
623af37
Merge branch 'savanna' into merge-main-04-10-2024
heifner Apr 11, 2024
16744a0
Merge pull request #23 from AntelopeIO/merge-main-04-10-2024
heifner Apr 11, 2024
295f7d4
GH-3 Add unittest for vote_processor. Modify vote_processor to make i…
heifner Apr 11, 2024
f13dae7
Merge branch 'spring/main' into main-04-11-2024
heifner Apr 11, 2024
18c2fca
GH-3 std::latch not available on all platforms; use std::atomic and f…
heifner Apr 11, 2024
d5cef78
GH-3 ci/cd is slow, allow more time.
heifner Apr 11, 2024
8ae27a1
Merge pull request #25 from AntelopeIO/main-04-11-2024
heifner Apr 11, 2024
da0106b
GH-3 Make test more robust by checking that node has received a hands…
heifner Apr 11, 2024
bf545e3
GH-3 Optimization: Don't emit duplicate votes
heifner Apr 11, 2024
d1fe636
GH-3 Fix: num_messages.clear() called before decrement
heifner Apr 11, 2024
f3ff3e8
GH-3 Avoid vote_message copies by using shared_ptr
heifner Apr 12, 2024
ae02196
GH-3 Avoid vote_message copies by using shared_ptr
heifner Apr 12, 2024
a6e4de8
GH-3 Fix tests now that duplicates are not signaled
heifner Apr 12, 2024
382f648
GH-3 Fix use of packed_transaction_ptr over shared_ptr<packed_transac…
heifner Apr 12, 2024
508b584
GH-3 There are three producers A,B,C if the test happens to hit this …
heifner Apr 12, 2024
4d70ab3
GH-3 Test failed on asan run because it took 55ms to load the WASM. I…
heifner Apr 12, 2024
23b5739
Merge remote-tracking branch 'spring/savanna' into GH-3-process-votes
heifner Apr 12, 2024
7f30795
Add test for `set_finalizers`, wip
greg7mdp Apr 12, 2024
06e6109
Delay sending handshakes on becoming in_sync until controller state i…
heifner Apr 12, 2024
1641a07
GH-3 Report known lib instead of fork db root as these log statements…
heifner Apr 12, 2024
51728b5
GH-14 Avoid one mutex lock and std::string construction on every log …
heifner Apr 13, 2024
b9a4ea6
GH-14 Add connection id to vote log output
heifner Apr 13, 2024
8deae48
GH-14 Remove unneeded includes
heifner Apr 13, 2024
9249e47
GH-14 Add noexcept
heifner Apr 13, 2024
8f8526b
GH-14 Replaced hotstuff logger with vote logger. Moved existing vote …
heifner Apr 15, 2024
919e923
First test of correct finalizer set change passes.
greg7mdp Apr 15, 2024
c8975e6
GH-14 Log connection id
heifner Apr 15, 2024
4bff371
GH-16 Add deep-mind ACCEPTED_BLOCK_V2
heifner Apr 15, 2024
fc4b48a
GH-16 Call deep-mind ACCEPTED_BLOCK_V2 during transition
heifner Apr 15, 2024
3e6d836
GH-14 Add comment that connection_id only for logging
heifner Apr 15, 2024
5147914
Add new testcase validating that latest `set_finalizer()` call in a b…
greg7mdp Apr 15, 2024
712b12d
GH-12 Rename proposal_digest to finalizer_digest. Rename proposal_id …
heifner Apr 15, 2024
eaa6e74
GH-12 Move finality misc tests to unittests
heifner Apr 15, 2024
c8cd1aa
GH-12 Rename hotstuff directory to finality
heifner Apr 15, 2024
8f02ecc
GH-12 Rename hotstuff.?pp to quorum_certificate.?pp. Move vote_messag…
heifner Apr 15, 2024
92f57fb
GH-12 Rename hs_bitset to vote_bitset. Remove unused code.
heifner Apr 15, 2024
4b4eca6
GH-3 Change default --vote-threads to 0 to be disabled by default. EO…
heifner Apr 15, 2024
bfbdcca
Merge pull request #27 from AntelopeIO/net-plugin-syncing-with-peer
heifner Apr 15, 2024
895cef7
GH-3 --vote-threads needed for all producers
heifner Apr 15, 2024
b0ee741
Fix empty action_mroot in Transition blocks
linh2931 Apr 15, 2024
359aa89
Merge branch 'savanna' into fix_empty_action_mroot
linh2931 Apr 15, 2024
fc2d50c
Use empty() instead of digest_type() to check whether a digest is empty
linh2931 Apr 16, 2024
68d4e8d
fix a couple compile warnings
spoonincode Apr 16, 2024
45f2e15
GH-12 Move finality_core to finality dir. Remove a few more reference…
heifner Apr 16, 2024
796dc5b
Merge remote-tracking branch 'spring/savanna' into GH-3-process-votes
heifner Apr 16, 2024
c3bdd8a
GH-12 Add vote threads needed for unittests
heifner Apr 16, 2024
e4010d2
GH-12 Add vote threads
heifner Apr 16, 2024
bf8fe18
GH-12 Add vote threads to tests
heifner Apr 16, 2024
57f8fde
GH-16 Refactor to remove literal constexpr
heifner Apr 16, 2024
0a28839
Rename block_state constructor with action_mroot parameter to create_…
linh2931 Apr 16, 2024
ded357d
adjust the assert for action_mroot_savanna
linh2931 Apr 16, 2024
78f42de
Merge pull request #32 from AntelopeIO/fix_empty_action_mroot
linh2931 Apr 16, 2024
ee2ca70
remove another unused variable
spoonincode Apr 16, 2024
3d65099
Merge pull request #35 from AntelopeIO/2compilewarns
spoonincode Apr 16, 2024
8bfbe0a
GH-3 Modify named_thread_pool to be a no-op if given 0 for num_threads.
heifner Apr 16, 2024
117f02d
GH-3 Check for stopped in inner loop
heifner Apr 16, 2024
027d278
GH-3 Add better descriptions
heifner Apr 16, 2024
8f26a50
GH-3 Default vote-threads to 4 when a block producer
heifner Apr 16, 2024
6cc6820
GH-3 Simplify by adding a vote_signal_t type
heifner Apr 16, 2024
166a580
GH-3 Use chain pluging accept_votes to init p2p_accept_votes
heifner Apr 16, 2024
83434d1
GH-3 Add vote-threads to all nodes so bridge nodes process votes
heifner Apr 16, 2024
917ca15
restore get_block_header_state endpoint
spoonincode Mar 5, 2024
eddbff8
remove hardware_destructive_interference_size to silence warn
spoonincode Apr 16, 2024
21e66b5
Merge pull request #41 from AntelopeIO/remove_hdis
spoonincode Apr 16, 2024
b89af83
avoid a copy; add test for invalid block id
spoonincode Apr 17, 2024
3e0d4c3
Increment finalizer_policy generation correctly
greg7mdp Apr 17, 2024
eb74ba0
`finalizer_policies` should be a `multimap`.
greg7mdp Apr 17, 2024
22ef766
Fix debugging output for `bls_public_key`
greg7mdp Apr 17, 2024
00e59ef
Complete basic unittests.
greg7mdp Apr 17, 2024
60bda6d
Check that range not empty before copying remainder of pending finali…
greg7mdp Apr 17, 2024
f894cdd
Remove code duplication in `set_finalizers` tests.
greg7mdp Apr 17, 2024
f6ddcce
Make getLatestSnapshot() and removeState() member functions of Node
linh2931 Apr 17, 2024
bf72494
Use `block_num_type` instead of `uint32_t`
greg7mdp Apr 17, 2024
3d1cddc
Avoid modifying data from previous `block_header_state`.
greg7mdp Apr 17, 2024
7f6a622
Remove unnecessary setting of `finalizer_policy::generation`
greg7mdp Apr 17, 2024
8cc3518
Merge branch 'savanna' of github.com:AntelopeIO/spring into gh_1618
greg7mdp Apr 17, 2024
25f93f8
Fix asan issue.
greg7mdp Apr 17, 2024
adf5c38
Merge pull request #40 from AntelopeIO/restore-gbhs
spoonincode Apr 17, 2024
608464d
Merge pull request #44 from AntelopeIO/getLatestSnapshot
linh2931 Apr 17, 2024
addf4a1
Merge branch 'savanna' of github.com:AntelopeIO/spring into gh_1618
greg7mdp Apr 17, 2024
042ce30
GH-3 Simplify vote_processor by processing votes on a first-come-firs…
heifner Apr 17, 2024
d80def5
GH-3 Fix use of iterator after erase
heifner Apr 17, 2024
74a1456
Create block_state for block_state_legacy for snapshot correctly duri…
linh2931 Apr 17, 2024
9f8da9e
Split up new finalizer update tests into new file.
greg7mdp Apr 17, 2024
5d226c4
Add comment for `finalizer_policies` multimap.
greg7mdp Apr 17, 2024
f5b58d8
GH-46 Do not advance LIB past HEAD. It is possible that HEAD is not o…
heifner Apr 18, 2024
47cf8a2
Add `reserve`
greg7mdp Apr 18, 2024
c98b221
Add comments.
greg7mdp Apr 18, 2024
3a80e26
Merge pull request #19 from AntelopeIO/gh_1618
greg7mdp Apr 18, 2024
432da13
GH-46 Fix irreversible mode and simplify fetch_head_branch.
heifner Apr 18, 2024
7c49979
Merge remote-tracking branch 'spring/savanna' into GH-16-deep-mind
heifner Apr 18, 2024
9498355
GH-16 Update DEEP_MIND_VERSION to spring 1 0.
heifner Apr 18, 2024
41eedfe
GH-16 Add apply chain_head function that takes a legacy and a savanna…
heifner Apr 18, 2024
317dd61
GH-3 Remove unneeded if
heifner Apr 18, 2024
955a72a
GH-3 Move emit to controller.hpp and use in vote_processor
heifner Apr 18, 2024
4a759b3
GH-3 Use same value as default for producer
heifner Apr 18, 2024
51503c4
GH-3 Use unordered_map
heifner Apr 18, 2024
b694aad
GH-3 Add better log message
heifner Apr 18, 2024
344b778
GH-3 Do not clear num_messages if there are votes in the index to be …
heifner Apr 18, 2024
ecc8cd4
GH-3 More descriptive emit logs
heifner Apr 18, 2024
4d09933
GH-46 Rename fetch_head_branch to fetch_branch
heifner Apr 18, 2024
8d3a838
GH-3 Fix spelling
heifner Apr 18, 2024
58fd209
Consolidate valid structure construction into create_transition_block()
linh2931 Apr 18, 2024
7a534b5
Merge pull request #52 from AntelopeIO/GH-46-lib-advance
heifner Apr 18, 2024
c3b5ed1
Merge pull request #29 from AntelopeIO/GH-16-deep-mind
heifner Apr 18, 2024
8165ec6
Merge branch 'spring/main' into merge-main-04-18-2024
heifner Apr 18, 2024
44ed0a4
Rename leap -> spring
heifner Apr 18, 2024
5e5c176
Merge pull request #24 from AntelopeIO/GH-3-process-votes
heifner Apr 19, 2024
2781b0f
Merge remote-tracking branch 'spring/savanna' into GH-14-vote-loggin
heifner Apr 19, 2024
6eb9d32
GH-14 Fix merge issue
heifner Apr 19, 2024
21bb4d0
Merge pull request #53 from AntelopeIO/merge-main-04-18-2024
heifner Apr 19, 2024
631cc49
GH-13 Add the beginning of a savanna disaster recovery test.
heifner Apr 19, 2024
395724e
Merge pull request #28 from AntelopeIO/GH-14-vote-loggin
heifner Apr 19, 2024
da4b294
GH-9 Do not use watermarks for savanna
heifner Apr 19, 2024
53673ea
Merge remote-tracking branch 'spring/savanna' into GH-12-cleanup
heifner Apr 19, 2024
64b77f4
Merge pull request #30 from AntelopeIO/GH-12-cleanup
heifner Apr 19, 2024
04638ad
Provide a common get_transition_savanna_block()
linh2931 Apr 19, 2024
2a42ea3
Add a new parameter waitForFinalization to activateInstantFinality an…
linh2931 Apr 19, 2024
f890149
Make sure snapshot is taken duiring transition
linh2931 Apr 19, 2024
36752d4
Merge branch 'savanna' into snapshot_transition_block_fix
linh2931 Apr 19, 2024
08a7157
Merge pull request #55 from AntelopeIO/GH-9-avoid-watermark
heifner Apr 19, 2024
c6ae7c6
pack the size of the bitset so it can be resized on unpack, otherwise…
heifner Apr 19, 2024
67ec8bc
Fix snapshot replay during transition to Savanna by reading both repr…
linh2931 Apr 21, 2024
09c4a90
Take snapshot in irreversible mode during transition to Savanna and r…
linh2931 Apr 21, 2024
8e1b918
Consider both replay with a snapshot and without a snapshot
linh2931 Apr 21, 2024
c9c7ae8
Merge branch 'savanna' into snapshot_transition_block_fix
linh2931 Apr 21, 2024
b24b8b6
Pack the size of the bitset instead of the size of blocks in the bitset.
heifner Apr 22, 2024
e1ccc35
Make replay_from_snapshot more clear
linh2931 Apr 22, 2024
ee8c1bd
Fix num_blocks logic and avoid extra copy of T
heifner Apr 22, 2024
2a15804
use replay_not_from_snapshot instead of replay_from_snapshot
linh2931 Apr 22, 2024
7bc7725
Simplify implementation
heifner Apr 22, 2024
39a7ab0
Merge remote-tracking branch 'spring/savanna' into GH-13-disaster-test
heifner Apr 22, 2024
053b53b
Merge pull request #45 from AntelopeIO/snapshot_transition_block_fix
linh2931 Apr 22, 2024
6b8bf26
GH-13 Move and use methods from Node.py
heifner Apr 23, 2024
0ec9115
Do not allow set_finalizers during transition
heifner Apr 23, 2024
21d9c58
Use is_if_transition_block()
heifner Apr 23, 2024
6a641c3
Add test for calling setfinalizer during transition
heifner Apr 23, 2024
166b981
Update log message
heifner Apr 23, 2024
b418127
Add some more descriptive Print statements
heifner Apr 23, 2024
31c2f86
Merge remote-tracking branch 'spring/savanna' into GH-13-disaster-test
heifner Apr 23, 2024
9115a1b
Merge remote-tracking branch 'spring/savanna' into bitset-pack-size
heifner Apr 23, 2024
ddcbbce
Standardize on use of boost::dynamic_bitset<uint8_t> for more expecte…
heifner Apr 23, 2024
b03ba95
Merge pull request #60 from AntelopeIO/setfinalizer-once
heifner Apr 23, 2024
d7fd8f3
Merge pull request #57 from AntelopeIO/bitset-pack-size
heifner Apr 23, 2024
477f3ae
GH-8 Add similar helper functions as block_header for extensions
heifner Apr 23, 2024
2a18889
GH-8 Add accessor for head active finalizer policy
heifner Apr 23, 2024
077248b
GH-8 Info log missing votes in block and warn log missing vote for co…
heifner Apr 23, 2024
38e4547
GH-8 Do not log no vote messages if syncing.
heifner Apr 23, 2024
484d40e
GH-8 Update help
heifner Apr 23, 2024
cf54b7a
GH-13 Remove dup code
heifner Apr 23, 2024
91312e5
Take snapshots directly instead of scheduling them
linh2931 Apr 23, 2024
914f117
GH-8 Shortcut out on id > extension_id
heifner Apr 23, 2024
56ea22e
GH-8 Update log messages
heifner Apr 23, 2024
96e2f68
GH-8 Use dynamic_bitset for not_voted calculation
heifner Apr 23, 2024
196ccc0
GH-13 Remove dup code
heifner Apr 23, 2024
3c4b0e0
Merge pull request #64 from AntelopeIO/fix_snapshot_in_svnn_transitio…
linh2931 Apr 23, 2024
e6b8d8b
GH-8 Add assert that extensions are sorted
heifner Apr 24, 2024
303c295
GH-13 Improve test by waiting on LIB and verifying advancement
heifner Apr 24, 2024
54812d4
Merge pull request #63 from AntelopeIO/GH-8-finalizer-log
heifner Apr 24, 2024
7315c1a
Merge remote-tracking branch 'spring/savanna' into GH-13-disaster-test
heifner Apr 24, 2024
7d29c5c
Use string for variant format of fc::dynamic_bitset
heifner Apr 24, 2024
470fe51
Reverse the string for more logical ordering
heifner Apr 24, 2024
e0490ad
Fix spelling
heifner Apr 24, 2024
968a4ab
GH-6 Avoid setting new proposer policy if there is no change
heifner Apr 24, 2024
40436dd
Decision to use boost string format for order of 0,1
heifner Apr 24, 2024
05aa152
Remove unneeded include
heifner Apr 24, 2024
41bee81
Rename reflected types so their JSON representation does not include …
heifner Apr 24, 2024
ef37672
Merge pull request #67 from AntelopeIO/dynamic_bitset_variant_format
heifner Apr 25, 2024
dcda785
Merge pull request #54 from AntelopeIO/GH-13-disaster-test
heifner Apr 25, 2024
85456a5
Merge branch 'savanna' into GH-6-proposer-policy
heifner Apr 25, 2024
162ae71
Add integration test for configuration where producer and finalizer n…
linh2931 Apr 25, 2024
da268fb
minor cleanup
linh2931 Apr 25, 2024
9df701c
GH-6 Add additional comments, cleanup up logic
heifner Apr 25, 2024
ed450d6
Add signature provider for non-producers only if requested
linh2931 Apr 25, 2024
29396aa
Merge pull request #68 from AntelopeIO/GH-6-proposer-policy
heifner Apr 25, 2024
e2b51a2
Fix misspelling seperate with separate
linh2931 Apr 25, 2024
7b47a1e
rename seperate_prod_fin_test.py to, seperate_prod_fin_test_shape.jso…
linh2931 Apr 26, 2024
11a63e5
use --signature-provider as option directly
linh2931 Apr 26, 2024
0ede8a0
GH-73 Avoid using fork in log messages that are not about micro-forks
heifner Apr 26, 2024
66f3c3a
Merge pull request #75 from AntelopeIO/GH-73-net-logs
heifner Apr 26, 2024
1c79072
Merge remote-tracking branch 'spring/main' into merge-main-04-26-2024
heifner Apr 26, 2024
254c463
GH-69 increase allowed unlinkable blocks from 15 to 250
heifner Apr 26, 2024
ea1b40e
GH-70 Log block exceptions as info level as they are not errors that …
heifner Apr 26, 2024
18f46b8
GH-70 Not necessarily an error to close connection
heifner Apr 26, 2024
b2f33e5
GH-69 Test failure was 219, use 500 instead of 250 to give more of a …
heifner Apr 26, 2024
aa0cfba
Merge branch 'savanna' into seperate_prod_fin
linh2931 Apr 27, 2024
46e7256
Merge pull request #80 from AntelopeIO/merge-main-04-26-2024
heifner Apr 27, 2024
ce9ebb8
GH-69 Print the number of unlinkable blocks found in each logfile
heifner Apr 27, 2024
70e4380
Merge pull request #83 from AntelopeIO/GH-70-log-level
heifner Apr 27, 2024
ea951d7
Implement new generation scheme for `finalizer_policy`
greg7mdp Apr 28, 2024
d9d935f
Merge branch 'savanna' of github.com:AntelopeIO/spring into gh_79
greg7mdp Apr 28, 2024
41f98fe
Improve comments
linh2931 Apr 28, 2024
9666fd3
Make peers connected to each other
linh2931 Apr 28, 2024
a7a555b
Merge pull request #71 from AntelopeIO/seperate_prod_fin
linh2931 Apr 28, 2024
a3698bd
fix a few small compile warnings
spoonincode Apr 28, 2024
8993cbd
Merge pull request #85 from AntelopeIO/compilewarns
spoonincode Apr 29, 2024
22000e2
Merge pull request #82 from AntelopeIO/GH-69-test-fix
heifner Apr 29, 2024
a2de799
Add logging for `finalizer_policy` proposals and change.
greg7mdp Apr 29, 2024
0a6f1f9
Merge branch 'savanna' of github.com:AntelopeIO/spring into gh_79
greg7mdp Apr 29, 2024
1b5972b
Merge pull request #84 from AntelopeIO/gh_79
greg7mdp Apr 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .cicd/defaults.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"cdt":{
"target":"4",
"target":"hotstuff_integration",
"prerelease":false
},
"referencecontracts":{
"ref":"main"
"ref":"instant-finality"
}
}
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ jobs:
error-log-paths: '["build/etc", "build/var", "build/spring-ignition-wd", "build/TestLogs"]'
log-tarball-prefix: ${{matrix.cfg.name}}
tests-label: long_running_tests
test-timeout: 1800
test-timeout: 2700
- name: Export core dumps
run: docker run --mount type=bind,source=/var/lib/systemd/coredump,target=/cores alpine sh -c 'tar -C /cores/ -c .' | tar x
if: failure()
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,4 @@ node_modules
package-lock.json

snapshots
!unittests/snapshots
1 change: 1 addition & 0 deletions CMakeModules/EosioTesterBuild.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ target_include_directories(EosioChain INTERFACE
@CMAKE_BINARY_DIR@/libraries/chain/include
@CMAKE_SOURCE_DIR@/libraries/libfc/include
@CMAKE_SOURCE_DIR@/libraries/libfc/libraries/boringssl/boringssl/src/include
@CMAKE_SOURCE_DIR@/libraries/libfc/libraries/bls12-381/include
@CMAKE_SOURCE_DIR@/libraries/softfloat/source/include
@CMAKE_SOURCE_DIR@/libraries/appbase/include
@CMAKE_SOURCE_DIR@/libraries/chainbase/include
Expand Down
15 changes: 11 additions & 4 deletions benchmark/benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ std::map<std::string, std::function<void()>> features {
{ "key", key_benchmarking },
{ "hash", hash_benchmarking },
{ "blake2", blake2_benchmarking },
{ "bls", bls_benchmarking }
{ "bls", bls_benchmarking },
{ "merkle", merkle_benchmarking }
};

// values to control cout format
Expand All @@ -34,6 +35,10 @@ void set_num_runs(uint32_t runs) {
num_runs = runs;
}

uint32_t get_num_runs() {
return num_runs;
}

void print_header() {
std::cout << std::left << std::setw(name_width) << "function"
<< std::setw(runs_width) << "runs"
Expand Down Expand Up @@ -63,12 +68,14 @@ bytes to_bytes(const std::string& source) {
return output;
};

void benchmarking(const std::string& name, const std::function<void()>& func) {
void benchmarking(const std::string& name, const std::function<void()>& func,
std::optional<size_t> opt_num_runs /* = {} */) {
uint64_t total{0};
uint64_t min{std::numeric_limits<uint64_t>::max()};
uint64_t max{0};
uint32_t runs = opt_num_runs ? *opt_num_runs : num_runs;

for (auto i = 0U; i < num_runs; ++i) {
for (auto i = 0U; i < runs; ++i) {
auto start_time = std::chrono::high_resolution_clock::now();
func();
auto end_time = std::chrono::high_resolution_clock::now();
Expand All @@ -79,7 +86,7 @@ void benchmarking(const std::string& name, const std::function<void()>& func) {
max = std::max(max, duration);
}

print_results(name, num_runs, total, min, max);
print_results(name, runs, total, min, max);
}

} // benchmark
5 changes: 4 additions & 1 deletion benchmark/benchmark.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
#include <map>
#include <vector>
#include <limits>
#include <optional>

#include <fc/crypto/hex.hpp>

namespace eosio::benchmark {
using bytes = std::vector<char>;

void set_num_runs(uint32_t runs);
uint32_t get_num_runs();
std::map<std::string, std::function<void()>> get_features();
void print_header();
bytes to_bytes(const std::string& source);
Expand All @@ -21,7 +23,8 @@ void key_benchmarking();
void hash_benchmarking();
void blake2_benchmarking();
void bls_benchmarking();
void merkle_benchmarking();

void benchmarking(const std::string& name, const std::function<void()>& func);
void benchmarking(const std::string& name, const std::function<void()>& func, std::optional<size_t> num_runs = {});

} // benchmark
3 changes: 2 additions & 1 deletion benchmark/bls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ struct interface_in_benchmark {
// build transaction context from the packed transaction
timer = std::make_unique<platform_timer>();
trx_timer = std::make_unique<transaction_checktime_timer>(*timer);
trx_ctx = std::make_unique<transaction_context>(*chain->control.get(), *ptrx, ptrx->id(), std::move(*trx_timer));
trx_ctx = std::make_unique<transaction_context>(*chain->control.get(), *ptrx, ptrx->id(), std::move(*trx_timer),
action_digests_t::store_which_t::legacy);
trx_ctx->max_transaction_time_subjective = fc::microseconds::maximum();
trx_ctx->init_for_input_trx( ptrx->get_unprunable_size(), ptrx->get_prunable_size() );
trx_ctx->exec(); // this is required to generate action traces to be used by apply_context constructor
Expand Down
69 changes: 69 additions & 0 deletions benchmark/merkle.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#include <benchmark.hpp>
#include <eosio/chain/incremental_merkle.hpp>
#include <eosio/chain/incremental_merkle_legacy.hpp>
#include <random>

namespace eosio::benchmark {

using namespace eosio::chain;

std::vector<digest_type> create_test_digests(size_t n) {
std::vector<digest_type> v;
v.reserve(n);
for (size_t i=0; i<n; ++i)
v.push_back(fc::sha256::hash(std::string{"Node"} + std::to_string(i)));
return v;
}

void benchmark_calc_merkle(uint32_t size_boost) {
using namespace std::string_literals;
const size_t num_digests = size_boost * 1000ull; // don't use exact powers of 2 as it is a special case

const std::vector<digest_type> digests = create_test_digests(num_digests);
const deque<digest_type> deq { digests.begin(), digests.end() };

auto num_str = std::to_string(size_boost);
while(num_str.size() < 4)
num_str.insert(0, 1, ' ');
auto msg_header = "Calc, "s + num_str + ",000 digests, "s;
uint32_t num_runs = std::min(get_num_runs(), std::max(1u, get_num_runs() / size_boost));
benchmarking(msg_header + "legacy: ", [&]() { calculate_merkle_legacy(deq); }, num_runs);
benchmarking(msg_header + "savanna:", [&]() { calculate_merkle(digests.begin(), digests.end()); }, num_runs);
}

void benchmark_incr_merkle(uint32_t size_boost) {
using namespace std::string_literals;
const size_t num_digests = size_boost * 1000ull; // don't use exact powers of 2 as it is a special case

const std::vector<digest_type> digests = create_test_digests(num_digests);

auto num_str = std::to_string(size_boost);
while(num_str.size() < 4)
num_str.insert(0, 1, ' ');
auto msg_header = "Incr, "s + num_str + ",000 digests, "s;
uint32_t num_runs = std::min(get_num_runs(), std::max(1u, get_num_runs() / size_boost));

auto incr = [&](const auto& incr_tree) {
auto work_tree = incr_tree;
for (const auto& d : digests)
work_tree.append(d);
return work_tree.get_root();
};

benchmarking(msg_header + "legacy: ", [&]() { incr(incremental_merkle_tree_legacy()); }, num_runs);
benchmarking(msg_header + "savanna:", [&]() { incr(incremental_merkle_tree()); }, num_runs);
}

// register benchmarking functions
void merkle_benchmarking() {
benchmark_calc_merkle(1000); // calculate_merkle of very large sequence (1,000,000 digests)
benchmark_calc_merkle(50); // calculate_merkle of large sequence (50,000 digests)
benchmark_calc_merkle(1); // calculate_merkle of small sequence (1000 digests)
std::cout << "\n";

benchmark_incr_merkle(100); // incremental_merkle of very large sequence (100,000 digests)
benchmark_incr_merkle(25); // incremental_merkle of large sequence (25,000 digests)
benchmark_incr_merkle(1); // incremental_merkle of small sequence (1000 digests)
}

}
27 changes: 27 additions & 0 deletions docs/block_production/lifecycle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
The following diagram describes Leap block production, as implemented in `libraries/chain/controller.cpp`:

```mermaid
flowchart TD
pp[producer_plugin] --> D
A("replay()"):::fun --> B("replay_push_block()"):::fun
B --> E("maybe_switch_forks()"):::fun
C("init()"):::fun ---> E
C --> A
D("push_block()"):::fun ---> E
subgraph G["apply_block()"]
direction TB
start -- "stage = &Oslash;" --> sb
sb("start_block()"):::fun -- "stage = building_block" --> et
et["execute transactions" ] -- "stage = building_block" --> fb("finish_block()"):::fun
fb -- "stage = assembled block" --> cb["add transaction metadata and create completed block"]
cb -- "stage = completed block" --> commit("commit_block() (where we [maybe] add to fork_db and mark valid)"):::fun

end
B ----> start
E --> G
D --> F("log_irreversible()"):::fun
commit -- "stage = &Oslash;" --> F
F -- "if in irreversible mode" --> G

classDef fun fill:#f96
```
12 changes: 11 additions & 1 deletion libraries/chain/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/genesis_state_root_key.cpp.in ${CMAKE

file(GLOB HEADERS "include/eosio/chain/*.hpp"
"include/eosio/chain/webassembly/*.hpp"
"include/eosio/chain/finality/*.hpp"
"${CMAKE_CURRENT_BINARY_DIR}/include/eosio/chain/core_symbol.hpp" )

if((APPLE AND UNIX) OR (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD"))
Expand Down Expand Up @@ -78,16 +79,24 @@ set(CHAIN_WEBASSEMBLY_SOURCES
webassembly/transaction.cpp
)

set(CHAIN_FINALITY_SOURCES
finality/finalizer.cpp
finality/instant_finality_extension.cpp
finality/quorum_certificate.cpp
finality/finality_core.cpp
)

add_library(eosio_rapidjson INTERFACE)
target_include_directories(eosio_rapidjson INTERFACE ../rapidjson/include)

## SORT .cpp by most likely to change / break compile
add_library( eosio_chain
merkle.cpp
name.cpp
transaction.cpp
block.cpp
block_header.cpp
block_header_state.cpp
block_state.cpp
block_header_state_legacy.cpp
block_state_legacy.cpp
fork_database.cpp
Expand Down Expand Up @@ -119,6 +128,7 @@ add_library( eosio_chain
${CHAIN_EOSVMOC_SOURCES}
${CHAIN_EOSVM_SOURCES}
${CHAIN_WEBASSEMBLY_SOURCES}
${CHAIN_FINALITY_SOURCES}

authority.cpp
trace.cpp
Expand Down
9 changes: 9 additions & 0 deletions libraries/chain/abi_serializer.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <eosio/chain/abi_serializer.hpp>
#include <eosio/chain/asset.hpp>
#include <eosio/chain/exceptions.hpp>
#include <eosio/chain/finality/instant_finality_extension.hpp>
#include <fc/io/raw.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <fc/io/varint.hpp>
Expand Down Expand Up @@ -633,6 +634,14 @@ namespace eosio { namespace chain {
_variant_to_binary(type, var, ds, ctx);
}

void impl::abi_to_variant::add_block_header_instant_finality_extension( mutable_variant_object& mvo, const header_extension_multimap& header_exts ) {
if (header_exts.count(instant_finality_extension::extension_id())) {
const auto& if_extension =
std::get<instant_finality_extension>(header_exts.lower_bound(instant_finality_extension::extension_id())->second);
mvo("instant_finality_extension", if_extension);
}
}

type_name abi_serializer::get_action_type(name action)const {
auto itr = actions.find(action);
if( itr != actions.end() ) return itr->second;
Expand Down
20 changes: 10 additions & 10 deletions libraries/chain/apply_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

using boost::container::flat_set;

namespace eosio { namespace chain {
namespace eosio::chain {

static inline void print_debug(account_name receiver, const action_trace& ar) {
if (!ar.console.empty()) {
Expand Down Expand Up @@ -184,7 +184,7 @@ void apply_context::exec_one()
r.auth_sequence[auth.actor] = next_auth_sequence( auth.actor );
}

trx_context.executed_action_receipt_digests.emplace_back( r.digest() );
trx_context.executed_action_receipts.compute_and_append_digests_from(trace);

finalize_trace( trace, start );

Expand Down Expand Up @@ -218,17 +218,17 @@ void apply_context::exec()
exec_one();
}

if( _cfa_inline_actions.size() > 0 || _inline_actions.size() > 0 ) {
if( !_cfa_inline_actions.empty() || !_inline_actions.empty() ) {
EOS_ASSERT( recurse_depth < control.get_global_properties().configuration.max_inline_action_depth,
transaction_exception, "max inline action depth per transaction reached" );
}

for( uint32_t ordinal : _cfa_inline_actions ) {
trx_context.execute_action( ordinal, recurse_depth + 1 );
}
for( uint32_t ordinal : _cfa_inline_actions ) {
trx_context.execute_action( ordinal, recurse_depth + 1 );
}

for( uint32_t ordinal : _inline_actions ) {
trx_context.execute_action( ordinal, recurse_depth + 1 );
for( uint32_t ordinal : _inline_actions ) {
trx_context.execute_action( ordinal, recurse_depth + 1 );
}
}

} /// exec()
Expand Down Expand Up @@ -1105,4 +1105,4 @@ bool apply_context::should_use_eos_vm_oc()const {
}


} } /// eosio::chain
} /// eosio::chain
44 changes: 42 additions & 2 deletions libraries/chain/block.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <eosio/chain/block.hpp>

namespace eosio { namespace chain {
namespace eosio::chain {
void additional_block_signatures_extension::reflector_init() {
static_assert( fc::raw::has_feature_reflector_init_on_unpacked_reflected_types,
"additional_block_signatures_extension expects FC to support reflector_init" );
Expand All @@ -20,6 +20,11 @@ namespace eosio { namespace chain {
}
}

void quorum_certificate_extension::reflector_init() {
static_assert( fc::raw::has_feature_reflector_init_on_unpacked_reflected_types, "quorum_certificate_extension expects FC to support reflector_init" );
static_assert( extension_id() == 3, "extension id for quorum_certificate_extension must be 3" );
}

flat_multimap<uint16_t, block_extension> signed_block::validate_and_extract_extensions()const {
using decompose_t = block_extension_types::decompose_t;

Expand Down Expand Up @@ -58,7 +63,42 @@ namespace eosio { namespace chain {
}

return results;
}

// Does not validate ordering, assumes validate_and_extract_extensions() has been called in verify_qc_claim()
std::optional<block_extension> signed_block::extract_extension(uint16_t extension_id)const {
using decompose_t = block_extension_types::decompose_t;

assert(std::ranges::is_sorted(block_extensions)); // currently all extensions are unique so default compare works

for( size_t i = 0; i < block_extensions.size(); ++i ) {
const auto& e = block_extensions[i];
auto id = e.first;

if (id > extension_id)
break;
if (id != extension_id)
continue;

std::optional<block_extension> ext;
ext.emplace();

auto match = decompose_t::extract<block_extension>( id, e.second, *ext );
EOS_ASSERT( match, invalid_block_extension,
"Block extension with id type ${id} is not supported",
("id", id)
);

return ext;
}

return {};
}

bool signed_block::contains_extension(uint16_t extension_id)const {
return std::any_of(block_extensions.cbegin(), block_extensions.cend(), [&](const auto& p) {
return p.first == extension_id;
});
}

} } /// namespace eosio::chain
} /// namespace eosio::chain
Loading
Loading