Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

wtmsig block production #7404

Merged
merged 49 commits into from
Jul 29, 2019
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
43bb220
more interim commits converting to extension
b1bart May 10, 2019
78b348a
extracted producer name in producer authorities to outside the versio…
b1bart May 10, 2019
98abd10
more fixing up stuff: wasm interface
b1bart May 10, 2019
c35b944
more fixes, into tester. need to go back and add new intrinsic
b1bart May 13, 2019
304fe31
So many fixes. renamed `name` back to `producer_name`. split intrin…
b1bart May 16, 2019
a965f0d
add new intrinsic, restore old intrinsic
b1bart May 16, 2019
55cdeac
add additional plumbing to get protocol feature activating, fix full …
b1bart May 17, 2019
474fc18
Merge branch 'feature/7254-handle-variant-aliases' into interim/block…
b1bart May 17, 2019
32b9296
update with new fc commits that fix variant comparisons
b1bart May 17, 2019
d6e77c8
update to integrated fc changes
b1bart May 20, 2019
51cce2a
fix ABI problems
b1bart May 20, 2019
a57656c
fix ABI and tester compatibility with variant differences
b1bart May 20, 2019
ab18793
Merge branch 'feature/7254-handle-variant-aliases' into interim/block…
b1bart May 20, 2019
ac0f620
fix more tests that relied on pre-authority producer schedules intent…
b1bart May 20, 2019
b90a0d2
work on multiple sigs
b1bart May 21, 2019
5f0a800
support for multiple signatures on blocks via block level extension
b1bart May 22, 2019
3cbbca2
update expected exception message
b1bart May 22, 2019
b88bbda
fix some bad accesses, remove the block extension check, add test cas…
b1bart May 22, 2019
6eb6a2b
snapshot version support for the changes to block header state
b1bart May 23, 2019
c708ea2
work on snapshot version tests
b1bart May 23, 2019
161f765
set the schedule_hash for block signature digests correctly based on …
b1bart May 23, 2019
a41e688
add a sigil that will trip once the unit test for version 2 is no lon…
b1bart May 23, 2019
b1781da
Merge branch 'feature/state_database_versioning' into interim/block-s…
b1bart May 24, 2019
a17ff6b
bump state database version to reflect change from producer_key to pr…
b1bart May 24, 2019
629e955
update testnet.template to use the least encumbered but upgradable bios
b1bart May 28, 2019
a0c474e
Merge remote-tracking branch 'origin/webauthn' into feature/7403-wtms…
b1bart May 28, 2019
bcf4c40
Merge remote-tracking branch 'origin/webauthn' into feature/7403-wtms…
b1bart May 28, 2019
4778001
fix compile errors and semantic errors from merge
b1bart May 28, 2019
0d91d0a
convert test back to legacy producer keys
b1bart May 28, 2019
cadfc14
Merge remote-tracking branch 'origin/webauthn' into feature/7403-wtms…
b1bart May 28, 2019
8cd3e53
Merge remote-tracking branch 'origin/webauthn' into feature/7403-wtms…
b1bart May 28, 2019
e8b6b24
Merge remote-tracking branch 'origin/webauthn' into feature/7403-wtms…
b1bart May 28, 2019
e91a7e0
fix errant unicode typo that I introduced
b1bart May 29, 2019
e5fcca3
update more test drivers for preactivate bios w/o producer authorities
b1bart May 29, 2019
0273294
fix more NP tests, also fix producer plugins capture of data that goe…
b1bart May 29, 2019
d3184ab
Merge remote-tracking branch 'origin/webauthn' into feature/7403-wtms…
b1bart Jun 6, 2019
796d255
Merge remote-tracking branch 'origin/webauthn' into feature/7403-wtms…
b1bart Jun 12, 2019
4ea7aac
merge origin/develop @ cb17d5e23cf3fbd485d8bb94e26e2db56e0bc4f1
b1bart Jul 16, 2019
7f68827
fix snapshot versioning test to reflect 1.8.1 changes
b1bart Jul 16, 2019
5789518
add protocol feature tests for wtmsig that ensure block validation ru…
b1bart Jul 17, 2019
b1b81f7
merge origin/develop
b1bart Jul 17, 2019
487387d
Add tests for producer schedule authority satisfiability, duplicated …
b1bart Jul 22, 2019
dbeef1a
merged origin/develop @ 81ccc4227315b2579051ab43bc0f77e8e87be461
b1bart Jul 22, 2019
e80e409
Forked tests had been instantiating peers with the expectation that t…
b1bart Jul 23, 2019
3a47de6
remove dangerous default constructor (no allocator), fix bad invocati…
b1bart Jul 23, 2019
510118a
addressing PR feedback
b1bart Jul 23, 2019
0d88b0b
address PR feedback from @arhag
b1bart Jul 24, 2019
607d70d
address more feedback on PR
b1bart Jul 25, 2019
5e0dc6d
address more PR feedback
b1bart Jul 26, 2019
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
2 changes: 2 additions & 0 deletions libraries/chain/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ add_library( eosio_chain
merkle.cpp
name.cpp
transaction.cpp
block.cpp
block_header.cpp
block_header_state.cpp
block_state.cpp
Expand Down Expand Up @@ -60,6 +61,7 @@ add_library( eosio_chain
protocol_state_object.cpp
protocol_feature_activation.cpp
protocol_feature_manager.cpp
producer_schedule.cpp
genesis_intrinsics.cpp
whitelisted_intrinsics.cpp
thread_utils.cpp
Expand Down
4 changes: 2 additions & 2 deletions libraries/chain/apply_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ void apply_context::schedule_deferred_transaction( const uint128_t& sender_id, a
("expected", trx_context.id)("actual", context.sender_trx_id)
);
} else {
b1bart marked this conversation as resolved.
Show resolved Hide resolved
FC_ASSERT( trx.transaction_extensions.size() == 0, "invariant failure" );
trx.transaction_extensions.emplace_back(
emplace_extension(
trx.transaction_extensions,
deferred_transaction_generation_context::extension_id(),
fc::raw::pack( deferred_transaction_generation_context( trx_context.id, sender_id, receiver ) )
);
Expand Down
68 changes: 68 additions & 0 deletions libraries/chain/block.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/**
* @file
* @copyright defined in eos/LICENSE
*/
#include <eosio/chain/block.hpp>
b1bart marked this conversation as resolved.
Show resolved Hide resolved

namespace eosio { namespace 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" );

EOS_ASSERT( signatures.size() > 0, ill_formed_additional_block_signatures_extension,
"Additional block signatures extension must contain at least one signature",
);

set<signature_type> unique_sigs;

for( const auto& s : signatures ) {
auto res = unique_sigs.insert( s );
EOS_ASSERT( res.second, ill_formed_additional_block_signatures_extension,
"Signature ${s} was repeated in the additional block signatures extension",
("s", s)
);
}
}

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

flat_multimap<uint16_t, block_extension> results;

uint16_t id_type_lower_bound = 0;

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

EOS_ASSERT( id >= id_type_lower_bound, invalid_block_extension,
"Block extensions are not in the correct order (ascending id types required)"
);

auto iter = results.emplace(std::piecewise_construct,
std::forward_as_tuple(id),
std::forward_as_tuple()
);

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

if( match->enforce_unique ) {
EOS_ASSERT( i == 0 || id > id_type_lower_bound, invalid_block_header_extension,
"Block extension with id type ${id} is not allowed to repeat",
("id", id)
);
}


id_type_lower_bound = id;
}

return results;

}

} } /// namespace eosio::chain
12 changes: 8 additions & 4 deletions libraries/chain/block_header.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ namespace eosio { namespace chain {
return result;
}

vector<block_header_extensions> block_header::validate_and_extract_header_extensions()const {
flat_multimap<uint16_t, block_header_extensions> block_header::validate_and_extract_header_extensions()const {
using block_header_extensions_t = block_header_extension_types::block_header_extensions_t;
using decompose_t = block_header_extension_types::decompose_t;

static_assert( std::is_same<block_header_extensions_t, block_header_extensions>::value,
"block_header_extensions is not setup as expected" );

vector<block_header_extensions_t> results;
flat_multimap<uint16_t, block_header_extensions> results;

uint16_t id_type_lower_bound = 0;

Expand All @@ -47,9 +47,12 @@ namespace eosio { namespace chain {
"Block header extensions are not in the correct order (ascending id types required)"
);

results.emplace_back();
auto iter = results.emplace(std::piecewise_construct,
std::forward_as_tuple(id),
std::forward_as_tuple()
);

auto match = decompose_t::extract<block_header_extensions_t>( id, e.second, results.back() );
auto match = decompose_t::extract<block_header_extensions_t>( id, e.second, iter->second );
EOS_ASSERT( match, invalid_block_header_extension,
"Block header extension with id type ${id} is not supported",
("id", id)
Expand All @@ -62,6 +65,7 @@ namespace eosio { namespace chain {
);
}


id_type_lower_bound = id;
}

Expand Down
Loading