This repository was archived by the owner on Nov 6, 2020. It is now read-only.
Misc docs and renames …and one less clone#11556
Merged
Merged
Conversation
…and one less clone
dvdplm
commented
Mar 10, 2020
| for i in 0 .. item_count { | ||
| let rlp = r.at(i)?; | ||
| let rlp = tx_rlp.at(i)?; | ||
| let tx = rlp.as_raw().to_vec(); |
Collaborator
Author
There was a problem hiding this comment.
I wanted to get rid of this copy here, but I can't make it work.
Collaborator
There was a problem hiding this comment.
I don't think it is possible because rlpin::Rlp is essentially a wrapper over &[u8], so one way or another you need to allocate to get Vec<u8> in safe Rust.
Collaborator
Author
There was a problem hiding this comment.
Yeah, my plan was to defer the allocation until we transform the rlp bytes into UnverifiedTransactions. But then the transform to UnverifiedTransaction has to happen outside the ClientIoMessage::Execute closure. And even then, that closure is an Fn and changing that to an FnOnce doesn't work because it can't be called when boxed and at that point I gave up.
ordian
reviewed
Mar 10, 2020
ordian
approved these changes
Mar 10, 2020
niklasad1
reviewed
Mar 10, 2020
niklasad1
approved these changes
Mar 10, 2020
niklasad1
reviewed
Mar 10, 2020
Co-Authored-By: Niklas Adolfsson <niklasadolfsson1@gmail.com>
ordian
added a commit
that referenced
this pull request
Mar 24, 2020
* master: informant: display I/O stats (#11523) [devp2p discovery]: remove `deprecated_echo_hash` (#11564) [secretstore] create db_version file when database doesn't exist (#11570) Remove Parity's Security Policy (#11565) ethcore/res: enable ecip-1088 phoenix upgrade for kotti and mordor testnets (#11529) Misc docs and renames …and one less clone (#11556) [secretstore]: don't sign message with only zeroes (#11561) [devp2p discovery]: cleanup (#11547) Code cleanup in the sync module (#11552) initial cleanup (#11542) Warn if genesis constructor revert (#11550)
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
I had a plan for a more extensive refactoring of
ClientMessage::Executebut it didn't pan out; this here is the random bits and pieces that survived. :(