This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Deep Mind off-chain ABI serializer & FC encoded hex output #9073
Merged
b1bart
merged 7 commits into
EOSIO:develop
from
dfuse-io:feature/offchain-abi-and-hex-output
Dec 3, 2020
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5195064
On boot, `nodeos` will now dump all known ABIs of each account.
abourget 734f60b
Offchain ABI serializer & fc encoded hex output
99813e7
Fixed compilation error when using `db.get_index<account_index>`
cdd36ed
Merge branch 'develop' into feature/offchain-abi-and-hex-output
3a6a8a8
Updated patch to latest deep mind version
adc58da
Reverted style change applied by mistake
786832b
Fixed PUSH_CREATE not returning fully signed transaction
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
There are no files selected for viewing
This file contains 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 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 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 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 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 |
---|---|---|
|
@@ -1266,9 +1266,11 @@ void chain_plugin::plugin_initialize(const variables_map& options) { | |
|
||
my->accepted_block_connection = my->chain->accepted_block.connect( [this]( const block_state_ptr& blk ) { | ||
if (auto dm_logger = my->chain->get_deep_mind_logger()) { | ||
auto packed_blk = fc::raw::pack(*blk); | ||
|
||
fc_dlog(*dm_logger, "ACCEPTED_BLOCK ${num} ${blk}", | ||
("num", blk->block_num) | ||
("blk", blk) | ||
("blk", fc::to_hex(packed_blk)) | ||
); | ||
} | ||
|
||
|
@@ -1291,9 +1293,11 @@ void chain_plugin::plugin_initialize(const variables_map& options) { | |
my->applied_transaction_connection = my->chain->applied_transaction.connect( | ||
[this]( std::tuple<const transaction_trace_ptr&, const packed_transaction_ptr&> t ) { | ||
if (auto dm_logger = my->chain->get_deep_mind_logger()) { | ||
auto packed_trace = fc::raw::pack(*std::get<0>(t)); | ||
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. Same here for the copy and const reference cast (for me when updating the PR). |
||
|
||
fc_dlog(*dm_logger, "APPLIED_TRANSACTION ${block} ${traces}", | ||
("block", my->chain->head_block_num() + 1) | ||
("traces", my->chain->maybe_to_variant_with_abi(std::get<0>(t), abi_serializer::create_yield_function(my->chain->get_abi_serializer_max_time()))) | ||
("traces", fc::to_hex(packed_trace)) | ||
); | ||
} | ||
|
||
|
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.
When a
shared_ptr
is used, it adds a first optionality byte to the binary data. So I had to use this here, but I'm wondering if this creates a copy of the structure prior packing it, I think it does.Is there a way to avoid it if it's the case? Can I cast somehow to a
const block_state&
type?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.
There is no copy of
*blk
before packing. Also,fc::raw::pack
takes its argument asconst T&
.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.
So what's pointing to the
shared_ptr
gets cast asconst ref
, perfect thanks!