-
Notifications
You must be signed in to change notification settings - Fork 862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate private transaction before sending to enclave #356
Merged
jframe
merged 30 commits into
hyperledger:master
from
jframe:validate_private_tx_before_enclave
Feb 10, 2020
Merged
Validate private transaction before sending to enclave #356
jframe
merged 30 commits into
hyperledger:master
from
jframe:validate_private_tx_before_enclave
Feb 10, 2020
Conversation
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
Signed-off-by: Jason Frame <jasonwframe@gmail.com>
Signed-off-by: Jason Frame <jasonwframe@gmail.com>
Signed-off-by: Jason Frame <jasonwframe@gmail.com>
Signed-off-by: Jason Frame <jasonwframe@gmail.com>
Signed-off-by: Jason Frame <jasonwframe@gmail.com>
Signed-off-by: Jason Frame <jasonwframe@gmail.com>
Signed-off-by: Jason Frame <jasonwframe@gmail.com>
Signed-off-by: Jason Frame <jasonwframe@gmail.com>
Signed-off-by: Jason Frame <jasonwframe@gmail.com>
Signed-off-by: Jason Frame <jasonwframe@gmail.com>
Signed-off-by: Jason Frame <jasonwframe@gmail.com>
rain-on
reviewed
Feb 3, 2020
...g/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/PrivacySendTransaction.java
Outdated
Show resolved
Hide resolved
...g/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/PrivacySendTransaction.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Jason Frame <jasonwframe@gmail.com>
Signed-off-by: Jason Frame <jasonwframe@gmail.com>
Signed-off-by: Jason Frame <jasonwframe@gmail.com>
Signed-off-by: Jason Frame <jasonwframe@gmail.com>
Signed-off-by: Jason Frame <jasonwframe@gmail.com>
Signed-off-by: Jason Frame <jasonwframe@gmail.com>
rain-on
reviewed
Feb 6, 2020
...yperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/eea/EeaSendRawTransaction.java
Outdated
Show resolved
Hide resolved
...er/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivDistributeRawTransaction.java
Show resolved
Hide resolved
...er/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivDistributeRawTransaction.java
Show resolved
Hide resolved
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/DefaultPrivacyController.java
Outdated
Show resolved
Hide resolved
...um/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateTransactionValidator.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Jason Frame <jasonwframe@gmail.com>
Signed-off-by: Jason Frame <jasonwframe@gmail.com>
Signed-off-by: Jason Frame <jasonwframe@gmail.com>
Signed-off-by: Jason Frame <jasonwframe@gmail.com>
rain-on
approved these changes
Feb 7, 2020
pinges
reviewed
Feb 7, 2020
|
||
public class PrivacyGroupUtil { | ||
|
||
public static String generateEeaPrivacyGroupId( |
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.
generate does not sound right for me. Maybe calculateEeaPrivacyGroupId?
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.
done
Signed-off-by: Jason Frame <jasonwframe@gmail.com>
Merged
GregTheGreek
pushed a commit
to ChainSafe/besu
that referenced
this pull request
Feb 27, 2020
* Plugin error stack traces (hyperledger#369) Because of how the Log4J2 api works exception stack traces were not being printed. Update to use the explicit "throwable" overloaded methods. Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com> * VM Trace fixes (hyperledger#372) * correct refund addresses * correct returned memory from static precompiled calls. * update integration test * precompiles sometimes get plain old CALLs Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com> * Validate private transaction before sending to enclave (hyperledger#356) Signed-off-by: Jason Frame <jasonwframe@gmail.com> * Trace API fixes (hyperledger#377) - Correct Reporting of reverts in nested call - correct reporting and handling of value transfer in nested calls - correct handling of precompiles via DELEGATECALL & CALLCODE - Addition of precompiled contract gas costs - Re-work handling of storage writes - Initial handling of gas refunds - fix bug in DELEGATECALL tests, we don't need gas in the stack * this has a cascading effect on balances in diff tests - rework depth detection in flat trace - two new tests blocks Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com> * [BOUNTY-2] Add NAT Docker Support (hyperledger#368) * add docker detection Signed-off-by: Karim TAAM <karim.t2am@gmail.com> * add port mapping detection Signed-off-by: Karim TAAM <karim.t2am@gmail.com> * add tests and refactor ip detection Signed-off-by: Karim TAAM <karim.t2am@gmail.com> * clean RunnerBuilder Signed-off-by: Karim TAAM <karim.t2am@gmail.com> * clean useless modification Signed-off-by: Karim TAAM <karim.t2am@gmail.com> * spotless Signed-off-by: Karim TAAM <karim.t2am@gmail.com> * resolve tests issues Signed-off-by: Karim TAAM <karim.t2am@gmail.com> * streamline auto detection Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com> Co-authored-by: Abdelhamid Bakhta <45264458+abdelhamidbakhta@users.noreply.github.com> Co-authored-by: Ratan Rai Sur <ratan.r.sur@gmail.com> * [PIE-1798] Priv RPC acceptance tests with stub enclave. (hyperledger#330) * [PIE-1798] Added some Privacy RPC ATs with a stub enclave. Signed-off-by: Mark Terry <mark.terry@consensys.net> * More specific task metrics names (hyperledger#389) A prior refactoring had accidentally removed the specific task names from the metrics labels. Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com> * More trace fixes (hyperledger#386) * pop flat trace context when handling halts * Better detection of precompiled and non-executed contracts * correct from address when calling in init code * fix some exotic nesting cases * correct from field for init code calls at depth >1 * correct cost on a non-call * changelog and notes Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com> * adding the plugin-api javadoc jar at the root level (hyperledger#378) Signed-off-by: Joshua Fernandes <joshua.fernandes@consensys.net> * BESU-56: remove erroneous links to errorprone checks (hyperledger#385) Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com> * Changelog entry for multi-tenancy feature (hyperledger#394) Signed-off-by: Edward Evans <edward.joshua.evans@gmail.com> Signed-off-by: Jason Frame <jasonwframe@gmail.com> * 1.5 RC Changelog (hyperledger#395) * 1.5 RC changelog additions Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net> * Fixed link (hyperledger#393) Signed-off-by: Madeline <madeline.murray@consensys.net> Co-authored-by: Edward <edjojob@gmail.com> * docker changelog (hyperledger#391) * docker changelog Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com> * address comments Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com> Co-authored-by: MadelineMurray <43356962+MadelineMurray@users.noreply.github.com> * Added known bug to changelog (hyperledger#388) * Added known bug Signed-off-by: Madeline <madeline.murray@consensys.net> * Added another known bug Signed-off-by: Madeline <madeline.murray@consensys.net> * updating version to 1.4.0-rc1 (hyperledger#397) Signed-off-by: Joshua Fernandes <joshua.fernandes@consensys.net> * updating verion to 1.4.1-snapshot (hyperledger#398) Signed-off-by: Joshua Fernandes <joshua.fernandes@consensys.net> * [BESU-169] cache logs bloom filters automatically. (hyperledger#367) * First iteration. Draft PR. Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * fix SPDX header Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * Use block broadcaster to index log bloom. Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * Remove useless toString method Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * spotless apply Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * cacheLogsBloomForBlockHeader Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * spotless apply Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * ensurePreviousSegmentsArePresent Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * Added CLI flag to enable / disable automatic logs bloom indexing. Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * Create cache directory and cache file if not exist. Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * Fix acceptance test Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * Write cache for block only if block is new canonical head. Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * Handling of chain reorg. Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * fix Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * sportless apply Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * Address PR comments. Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * Remove unused constant. Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * spotless apply Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * [BESU-25] Use Devp2p Ping packets at v5 (hyperledger#392) Broadcast that we support snappy compression Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com> * Rename logs bloom indexer to log bloom cache to match CLI flag. (hyperledger#401) Changes class names, variables, and CLI flags as needed. Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com> * [PIE-1798] Fail cases for multitenancy ATs (hyperledger#400) Signed-off-by: Mark Terry <mark.terry@consensys.net> * Private state update metadata and migration (hyperledger#404) (backport from release-1.4) Private state update metadata and migration Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net> * [PIE-2303] Automatic log bloom caching - Remove usage of pending file. (hyperledger#407) * Don't use pending file. Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * Don't use pending file. Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * Create a custom error when plugin is not found. (hyperledger#409) Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * Rename method (hyperledger#412) * rename the method isPersistingState to isPersistingPrivateState because that is what it is used for Signed-off-by: Stefan Pingel <stefan.pingel@consensys.net> * rename the method isPersistingState to isPersistingPrivateState because that is what it is used for Signed-off-by: Stefan Pingel <stefan.pingel@consensys.net> * rename the method isPersistingState to isPersistingPrivateState because that is what it is used for Signed-off-by: Stefan Pingel <stefan.pingel@consensys.net> * [BOUNTY-4] Add NAT Kubernetes Support (hyperledger#410) * add kubernetes support Signed-off-by: Karim TAAM <karim.t2am@gmail.com> * fix review issues Signed-off-by: Karim TAAM <karim.t2am@gmail.com> * LogBloomCache - make sure the current segment is filled (hyperledger#411) Make sure we cache the current cache segment with all of the data from the beginning of the segment. Use a flip file approach since it will be a partial file until done. Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com> Co-authored-by: Abdelhamid Bakhta <45264458+abdelhamidbakhta@users.noreply.github.com> * Reduce recaching in Transaction Log Bloom Filter Cache (hyperledger#415) Do a cursory cache check at start up (file is present and correct size) instead of re-generating the cache at startup. Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com> * fix order of nat detector (hyperledger#414) Signed-off-by: Karim TAAM <karim.t2am@gmail.com> * Update SLOAD_GAS cost to 200 in Aztlan Gas Calculator (#23) (hyperledger#382) * Update SLOAD_GAS cost to 200 in Aztlan Gas Calculator Change SLOAD_GAS cost in Aztlan Gas Calculator from 800 to 200 and update functions that use SLOAD_GAS. Signed-off-by: edwardmack <ed@edwardmack.com> * Update SLOAD_GAS cost to 200 in Aztlan Gas Calculator Change SLOAD_GAS cost in Aztlan Gas Calculator from 800 to 200 and update functions that use SLOAD_GAS. Signed-off-by: edwardmack <ed@edwardmack.com> Signed-off-by: Edward Mack <ed@edwardmack.com> * remove overrides removed overrides of calculateStorageCost and calculateStorageRefundAmount in AztlanGasCalculator because these were causing aztlan fork not to sync with kotti testnet. Signed-off-by: Edward Mack <ed@edwardmack.com> * merge Signed-off-by: Edward Mack <ed@edwardmack.com> * Remove unused ExecutorService init/termination (hyperledger#419) Signed-off-by: Horacio Mijail Anton Quiles <hmijail@gmail.com> Co-authored-by: CJ Hare <CjHare@users.noreply.github.com> * Implement Eth/64 (hyperledger#425) Wire in the fork identifier into the status messages as Eth64. Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com> * Adds priv_getcode (hyperledger#428) * Adds priv_getcode Signed-off-by: Joshua Richardson <joshua@richardson.tech> * BESU-146 - check if success and return errorResponse otherwise (hyperledger#424) Signed-off-by: Anthony Buckle <anthonybuckle@gmail.com> Co-authored-by: CJ Hare <CjHare@users.noreply.github.com> * fixed typos (hyperledger#429) Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net> Co-authored-by: CJ Hare <CjHare@users.noreply.github.com> * roll back on ALL-CAPS.md files for TSC proposal (hyperledger#376) Signed-off-by: Felipe Faraggi <felipefaraggi@gmail.com> * updating the changelog with 1.4.0 details (hyperledger#431) Signed-off-by: Joshua Fernandes <joshua.fernandes@consensys.net> * [BESU-194] Remove max pivot block resets during fast sync (hyperledger#427) * remove max pivot block resets during fast sync * increase max retry number and fix test * change logs in the handleFailure method * change logs related to suspicious number of retries Signed-off-by: Karim TAAM <karim.t2am@gmail.com> Co-authored-by: Danno Ferrin <danno.ferrin@shemnon.com> Co-authored-by: Jason Frame <jasonwframe@gmail.com> Co-authored-by: Karim T. <karim.t2am@gmail.com> Co-authored-by: Abdelhamid Bakhta <45264458+abdelhamidbakhta@users.noreply.github.com> Co-authored-by: Ratan Rai Sur <ratan.r.sur@gmail.com> Co-authored-by: mark-terry <36909937+mark-terry@users.noreply.github.com> Co-authored-by: Joshua Fernandes <joshua.fernandes@consensys.net> Co-authored-by: Antoine Toulme <atoulme@users.noreply.github.com> Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net> Co-authored-by: MadelineMurray <43356962+MadelineMurray@users.noreply.github.com> Co-authored-by: Edward <edjojob@gmail.com> Co-authored-by: Lucas Saldanha <lucascrsaldanha@gmail.com> Co-authored-by: pinges <16143240+pinges@users.noreply.github.com> Co-authored-by: Horacio Mijail Antón Quiles <4139546+hmijail@users.noreply.github.com> Co-authored-by: CJ Hare <CjHare@users.noreply.github.com> Co-authored-by: anthonybuckle <anthonybuckle@gmail.com> Co-authored-by: Felipe Faraggi <felipefaraggi@gmail.com>
siladu
pushed a commit
to siladu/besu
that referenced
this pull request
Oct 28, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR description
This changes the privacy send transaction RPCs eea_sendRawTransaction and priv_distrubuteRawTransaction to validate transactions before they send to the enclave or added to the transaction pool. Currently some lightweight validation is done after receiving the transaction, it is then sent to the enclave, and then it is validated. This changes it processing so the validation happens before sending to the enclave.
Because the validation now happens before sending to the enclave the privacy group for EEA private transactions must be calculated up front instead using the privacy group id returned from the Enclave. This PR uses web3j to do calculate the privacy group id for these transactions.
Fixed Issue(s)