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 5 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
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.
packed_signed_trx
materially different frompacked_trx
? This looks like an unnecessary "round trip" with line 626 aboveThere 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.
I'll double check, I remember some had subtle differences when packing not giving the exact same output format, specially related to signature. One was giving an output with signature the other not, but I don't remember if this one was problematic or not.
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, it appears
packed_trx
wouldby re-packing it it should always be uncompressed and only the transaction BUT i don't think it will have signatures.
packed_transaction::get_transaction() const
returns atransaction
not asigned_transaction
. Also, thisis a deferred transaction which has no signatures. Please rename the variable to something likeserialized_trx
so that future readers do not expect this blob to contain signatures.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.
In version 2.x of deep mind branch, this was outputting signature (for delayed pushed transaction which is the case here). You are right that is not a
signed_trx
anymore here, it's a plain transaction without the signature.Now, I checked and using
fc::to_hex(packed_trx.get_packed_transaction().data(), packed_trx.get_packed_transaction().size())
does not print signature neither. That would have been a correct change since we could have uncompress the transaction if it was compressed.Now, I think my best way of handling it here is to also output the signatures directly, hoping they are not pruned which seems the case here.
This does not compile yet because
error: no member named 'visit' in 'fc::reflector<const std::__1::vector<fc::crypto::signature, std::__1::allocator<fc::crypto::signature> > *>'
when used in a mutable variable object for printing like this:I still have some holes in my understanding of the bigger serialization format around fc and EOSIO codebase, but I don't see yet why it complains like this. The
fc::crypto::signature
has specializedto_variant
andfrom_variant
overload as well as having a dedicatedFC_REFLECT(fc::crypto::signature, (_storage) )
definition.So maybe you could give me some hint here to find why it's not working.
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.
You have two options here:
maintain the course with your new serialization, you should dereference the pointer so that the
mutable_variant_object
receives aconst std::vector<signature_type>&
instead of a pointer.go back to the original and change it to:
which should give you what you were seeing in the 2.x version
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.
Thanks for the tips.
I went with the original output and the extra hop of turning it into a v0 packed transaction. It was easier to go that route, specially since I would also needed to add
context_free_data
.