-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add filtering capability to parity_pendingTransactions
(issue 8269)
#10506
Conversation
Upstream merges
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
It looks like @lamafab signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
Upstream merges
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.
Looks good as a starting point, I think I'd go one step further and make the implementation more complete in terms of possible options to filtering but also to avoid breaking backward compatibility (the preoposed filtering object could be made optional with a some default value).
I'm having slight trouble testing the code; ready_transactions (the original implementation) always returns two pending transactions on me, never more.
That's because RPC tests are not using the real MiningService
, but rather one for tests.
It would be best to test the serialisation/deserialisation in RPC tests, but the filtering logic deserves a separate test in miner
module.
@lamafab needs merging with master |
@tomusdrw @ascjones How quickly do those changes need to be implemented? I'm currently going through exam week, but I can complete this PR, soon. However, I can not guarantee on exactly when... Regarding testing: I will skip the direct |
@tomusdrw @ascjones Alright, I did it! The unified FilterOptions are now implemented in this PR.
What this PR contains:
What's missing
Thank you very much (and for the patience!) |
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.
Awesome work! Only few small nits.
} | ||
|
||
#[cfg(test)] | ||
mod tests { |
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.
❤️
Amazing work 🤝 |
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.
Beautiful work here.
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.
lgtm
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 nice feedback, everyone. I've added some very small changes (like adding a newline at the end of the file as @seunlanlege suggested). EDIT: Looks like the failed CI tests are not related to my changes... (?) Last time this happened too, I remember restarting the CI tests solved the issues. |
…ckChain * master: revert changes to .gitlab-ci.yml (#10807) Add filtering capability to `parity_pendingTransactions` (issue 8269) (#10506) removed EthEngine alias (#10805) wait a bit longer in should_check_status_of_request_when_its_resolved (#10808) Do not drop the peer with None difficulty (#10772) ethcore-bloom-journal updated to 2018 (#10804) ethcore-light uses bincode 1.1 (#10798) Fix a few typos and unused warnings. (#10803) updated project to ansi_term 0.11 (#10799) added new ropsten-bootnode and removed old one (#10794) updated price-info to edition 2018 (#10801) ethcore-network-devp2p uses igd 0.9 (#10797) updated parity-local-store to edition 2018 and removed redundant Error type (#10800)
…me-parent * master: (24 commits) cargo update -p smallvec (#10822) replace memzero with zeroize crate (#10816) Don't repeat the logic from Default impl (#10813) removed additional_params method (#10818) Add Constantinople eips to the dev (instant_seal) config (#10809) removed redundant fmt::Display implementations (#10806) revert changes to .gitlab-ci.yml (#10807) Add filtering capability to `parity_pendingTransactions` (issue 8269) (#10506) removed EthEngine alias (#10805) wait a bit longer in should_check_status_of_request_when_its_resolved (#10808) Do not drop the peer with None difficulty (#10772) ethcore-bloom-journal updated to 2018 (#10804) ethcore-light uses bincode 1.1 (#10798) Fix a few typos and unused warnings. (#10803) updated project to ansi_term 0.11 (#10799) added new ropsten-bootnode and removed old one (#10794) updated price-info to edition 2018 (#10801) ethcore-network-devp2p uses igd 0.9 (#10797) updated parity-local-store to edition 2018 and removed redundant Error type (#10800) Cleanup unused vm dependencies (#10787) ...
* master: (22 commits) ethcore does not use byteorder (#10829) Better logging when backfilling ancient blocks fail (#10796) depends: Update wordlist to v1.3 (#10823) cargo update -p smallvec (#10822) replace memzero with zeroize crate (#10816) Don't repeat the logic from Default impl (#10813) removed additional_params method (#10818) Add Constantinople eips to the dev (instant_seal) config (#10809) removed redundant fmt::Display implementations (#10806) revert changes to .gitlab-ci.yml (#10807) Add filtering capability to `parity_pendingTransactions` (issue 8269) (#10506) removed EthEngine alias (#10805) wait a bit longer in should_check_status_of_request_when_its_resolved (#10808) Do not drop the peer with None difficulty (#10772) ethcore-bloom-journal updated to 2018 (#10804) ethcore-light uses bincode 1.1 (#10798) Fix a few typos and unused warnings. (#10803) updated project to ansi_term 0.11 (#10799) added new ropsten-bootnode and removed old one (#10794) updated price-info to edition 2018 (#10801) ...
* master: (21 commits) refactor: whisper: Add type aliases and update rustdocs in message.rs (#10812) Break circular dependency between Client and Engine (part 1) (#10833) tests: Relates to #10655: Test instructions for Readme (#10835) refactor: Related #9459 - evmbin: replace untyped json! macro with fully typed serde serialization using Rust structs (#10657) idiomatic changes to PodState (#10834) Allow --nat extip:your.host.here.org (#10830) When updating the client or when called from RPC, sleep should mean sleep (#10814) Remove excessive warning (#10831) Fix typo in README.md (#10828) ethcore does not use byteorder (#10829) Better logging when backfilling ancient blocks fail (#10796) depends: Update wordlist to v1.3 (#10823) cargo update -p smallvec (#10822) replace memzero with zeroize crate (#10816) Don't repeat the logic from Default impl (#10813) removed additional_params method (#10818) Add Constantinople eips to the dev (instant_seal) config (#10809) removed redundant fmt::Display implementations (#10806) revert changes to .gitlab-ci.yml (#10807) Add filtering capability to `parity_pendingTransactions` (issue 8269) (#10506) ...
Hi
This pull request adds filtering capabilities for
parity_pendingTransactions
, as requested in issue #8269.Changes
ready_transactions_filtered
method, which can filter transactions by hash, sender or receiver.ready_transactions
method wraps over the filter, thereforeready_transactions_filtered
can be called directly from the RPC interface without having to adjust code through the whole codebase.Considerations
I'm having slight trouble testing the code;
ready_transactions
(the original implementation) always returns two pending transactions on me, never more. This makes testing inconvenient. It might be related to a detail in the test miner that I'm missing, basing my assumption on this method description:If someone can point me in the right direction I can write some complete test cases (so far, NO testing is being done).
See
fn filter_pending_transactions_by_tx_hash()
inethcore/src/miner/miner.rs
for more.Any feedback is welcome!