* some unit tests
Signed-off-by: Frank Li <b439988l@gmail.com>
* CLI parsing tests
Signed-off-by: Frank Li <b439988l@gmail.com>
* regression tests
Signed-off-by: Frank Li <b439988l@gmail.com>
* fix failing at
Signed-off-by: Frank Li <b439988l@gmail.com>
* refactor -> api to api methods
Signed-off-by: Frank Li <b439988l@gmail.com>
* functionality in
Signed-off-by: Frank Li <b439988l@gmail.com>
* fix override test
Signed-off-by: Frank Li <b439988l@gmail.com>
* fix duplicates test
Signed-off-by: Frank Li <b439988l@gmail.com>
* fix duplicates test
Signed-off-by: Frank Li <b439988l@gmail.com>
* fix failing test and remove unnecessary code
Signed-off-by: Frank Li <b439988l@gmail.com>
* add entry to changelog
Signed-off-by: Frank Li <b439988l@gmail.com>
* fix typo and NPE
Signed-off-by: Frank Li <b439988l@gmail.com>
* action on some items
Signed-off-by: Frank Li <b439988l@gmail.com>
* some refactoring + more tests + implement auth skip for web sockets
Signed-off-by: Frank Li <b439988l@gmail.com>
* refactor unused method
Signed-off-by: Frank Li <b439988l@gmail.com>
* fix test failing
Signed-off-by: Frank Li <b439988l@gmail.com>
* fix wrong variable used
Signed-off-by: Frank Li <b439988l@gmail.com>
* Fix bft acceptance tests
Only set genesis config if it is not already set. Throw if user attempts to verify an empty cluster.
Configure genesis file with appropriate keys for consensus type.
Signed-off-by: Meredith Baxter <meredith.baxter@palm.io>
* Fix SECP256R1AcceptanceTest
Signed-off-by: Meredith Baxter <meredith.baxter@palm.io>
* Add option to enforce tx replay protection for local txs
* Only enforce replay protection if the current milestone supports it
* moved changelog entry to next release
Signed-off-by: Meredith Baxter <meredith.baxter@palm.io>
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
* lots of errorprone fixes
* some license updates
* some mockito updates
* upgrade the rocksdb version
* Prometheus left at 0.9.0 as 0.10.0+ introduces OpenMetrics
related changes that break unit tests.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* CLI option name change
Signed-off-by: Frank Li <b439988l@gmail.com>
* refactor privacyparameters.java and add deprecation warning
Signed-off-by: Frank Li <b439988l@gmail.com>
* more refactoring
Signed-off-by: Frank Li <b439988l@gmail.com>
* add to everything.toml
Signed-off-by: Frank Li <b439988l@gmail.com>
* bugs
Signed-off-by: Frank Li <b439988l@gmail.com>
* more missing variable names
Signed-off-by: Frank Li <b439988l@gmail.com>
* more classes
Signed-off-by: Frank Li <b439988l@gmail.com>
* more classes
Signed-off-by: Frank Li <b439988l@gmail.com>
* fix compile error
Signed-off-by: Frank Li <b439988l@gmail.com>
* add new test to invalidate passing both commands
Signed-off-by: Frank Li <b439988l@gmail.com>
* more refactoring + more tests
Signed-off-by: Frank Li <b439988l@gmail.com>
* new batch
Signed-off-by: Frank Li <b439988l@gmail.com>
* final batch?
Signed-off-by: Frank Li <b439988l@gmail.com>
* failing unit test
Signed-off-by: Frank Li <b439988l@gmail.com>
* revert incorrect refactoring back to onchain
Signed-off-by: Frank Li <b439988l@gmail.com>
* fix unit test
Signed-off-by: Frank Li <b439988l@gmail.com>
* comment
Signed-off-by: Frank Li <b439988l@gmail.com>
* comment
Signed-off-by: Frank Li <b439988l@gmail.com>
* support both privx methods
Signed-off-by: Frank Li <b439988l@gmail.com>
* add to changelog
Signed-off-by: Frank Li <b439988l@gmail.com>
* address comment
Signed-off-by: Frank Li <b439988l@gmail.com>
* add plugin privacy
Signed-off-by: Frank Li <b439988l@gmail.com>
Removes Ethsigner to Besu acceptance tests as these are covered in EthSigner and other cross client testing tools.
Signed-off-by: Jason Frame <jasonwframe@gmail.com>
* add unit test for JWTAuthOptionsFactory
Signed-off-by: Frank Li <b439988l@gmail.com>
* additional test for invalid algo
Signed-off-by: Frank Li <b439988l@gmail.com>
* WIP || Think about how to handle the invalid algorithm exception
Signed-off-by: Frank Li <b439988l@gmail.com>
* WIP || Handle exception at BesuCommand level, remove test
Signed-off-by: Frank Li <b439988l@gmail.com>
* WIP || Acceptance Tests
Signed-off-by: Frank Li <b439988l@gmail.com>
* WIP || Fix obvios test run errors
Signed-off-by: Frank Li <b439988l@gmail.com>
* WIP || Break long line of string
Signed-off-by: Frank Li <b439988l@gmail.com>
* Acceptance tests working
Signed-off-by: Frank Li <b439988l@gmail.com>
* remove accidentally committed file
Signed-off-by: Frank Li <b439988l@gmail.com>
* fix failing tests
Signed-off-by: Frank Li <b439988l@gmail.com>
* changelog entry
Signed-off-by: Frank Li <b439988l@gmail.com>
* fixes based on CR
Signed-off-by: Frank Li <b439988l@gmail.com>
* add missed acceptance test stuff
Signed-off-by: Frank Li <b439988l@gmail.com>
* use enum for CLI arg
Signed-off-by: Frank Li <b439988l@gmail.com>
* two seperate CLI args for ws and http
Signed-off-by: Frank Li <b439988l@gmail.com>
* add file header
Signed-off-by: Frank Li <b439988l@gmail.com>
* use JwtAlgorithm class + fix broken unit test
Signed-off-by: Frank Li <b439988l@gmail.com>
* add fromString
Signed-off-by: Frank Li <b439988l@gmail.com>
* experimental flag || changelog update || CLI option dependency
Signed-off-by: Frank Li <b439988l@gmail.com>
* hide exprimental options
Signed-off-by: Frank Li <b439988l@gmail.com>
* remove experimental flag
Signed-off-by: Frank Li <b439988l@gmail.com>
* change experimental options in toml
Signed-off-by: Frank Li <b439988l@gmail.com>
* Only add --bootnodes if there are some nodes set (#1632)
Signed-off-by: Diego López León <dieguitoll@gmail.com>
* Allow to configure P2P port (#1632)
Signed-off-by: Diego López León <dieguitoll@gmail.com>
* Add discovery options to genesis file (#1632)
Signed-off-by: Diego López León <dieguitoll@gmail.com>
This is a re-implementation of the initial POC done in https://github.com/PegaSysEng/pantheon/pull/1909/ by Danno Ferrin <danno.ferrin@gmail.com>
* Only enable plugin rpc api when enabled on --rpc-http-api or --rpc-ws-apis
* Only allow new rpc endpoints to be defined
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
Private accounts are not able to change the state of public accounts. When transferValue is called in MessageCallProcessor it attempts to get a mutable account. This is only required when a transfer of value is happening. If a transfer of value from a private contract to a public contract is attempted an error will be thrown.
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
Move EVM to a standalone module
Move the EVM classes to a standalone module. This is mostly moves but
some API re-resign to peel out some features not essential to the EVM,
such as privacy support and ties to the data storage subsystem.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* Create new datatypes module
Create a new `datatypes` module to hold datatypes that are broadly used.
This will aid modularization by making sure the base types in the module
minimize the amount of unrelated support classes needed.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* Add Address, Hash, and Wei to datatypes
Move the Address, Hash, and Wei to datatypes in as they are needed for
EVM modularization.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* allow onchain privacy group proxy calls under group lock
Prior to this commit, the only allowed transactions in locked onchain
privacy groups were those making the addParticipants call to *any*
contract--not just the proxy. This commit ensures that:
- while locked, only the group management proxy can be called
- while locked, all functions of the management proxy can be called
Corollary, this commit allows unlocking a group using unlock instead
of implicitely unlocking it via addParticipants. This fixes#2693.
Signed-off-by: Taccat Isid <taccatisid@protonmail.com>
* add acceptance test asserting that privacy groups can be unlocked
Signed-off-by: Taccat Isid <taccatisid@protonmail.com>
Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
* Refactor: PrivacyBlockProcessor to clarify intent
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Wire up privacy genesis options into PrivacyParameters
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Refactor private state genesis into it's own class
- pass through in privacyParameters
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Refactor: inject PrivateStateGenesis into PrivacyPrecompiles
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Private Genesis initialisation
- set code, balance and storage from private-genesis.json
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Check on-chain with private genesis in acceptance tests
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Remove unused EthGetCodeCall
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Use a plugin based aproach for privacy genesis
- if the plugin is registered it will be used to apply private genesis
state
- if onchain flexible privacy groups is enable that will be applied
after
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* PrivateGenesisAcceptanceTest::createPrivacyGroup can be private
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* PrivateStateGenesis add debug logs
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Warn if genesis account allocation is in reserved precompile range
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Add sender into unsignedPrivateMarkerTransaction for plugin to make descision
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Remove locking solution as may not be needed
- if this is required we should first evaluate actual use cases
and test scenarios
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Rename PrivateStateGenesis -> PrivateStateGenesisAllocator
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Tidy up naming for getPrivateStateGenesisAllocator
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Privacy Plugin javadocs
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
Update spotless to 5.14.2 and java-google-format to 1.10.0.
Both of these are needed to support Java 16 and Gradle 7.x.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* Refactor: clarify intent of arg when testing permissioning plugin
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Refactor: remove duplicate createPrivateMarkerTransaction
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* PrivateMarkerTransactionFactory: add option to delegate to plugin
if defined the plugin will be responsible for creating the pmt
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Implement locking strategy for eea_sendRawTransaction
- this will lock per address being sent to prevent nonce
too low errors
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Refactor plugin integration to use a more explicit poco
- the plugin will need to sign the transaction with the data it's given
- it will not need to query anything e.g nonce etc
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* refactor: update naming and tidy up based on comments
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Isolate code for calculating gas limit when using privacy plugin
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
Co-authored-by: Vijay Michalik <vijay.michalik@consensys.net>
* Upgrade to Apache Tuweni 2.0
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Remove intermediate repository
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Remove all occurrences of toBytes
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Migrate to tuweni-bytes
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* add changelog
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* correct reference tests
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Initial API changes
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* more changes
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Change APIs for VM ops
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Use constant UInt256.ONE
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Optimize a bit address <> word transformation
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* spotless
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Hook up an empty plugin for future unrestricted privacy encryption
Skeleton implementation for PrivacyPayloadEncryptionProvider
Wire up unencrypted serialization for private transactions
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* wire up simple privacy plugin in acceptance tests
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Pass the marker transaction through to plugin
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Move getters/setters into consistent place
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Rename plugin methods and config to be more generic
- remove protections around transaction.restriction
- the plugin is responsible for this
- make plugin more generic so could be used for restricted/unrestricted
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Provide more meaningful error message
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Fix up test naming to match impl naming
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Rename UNRESTRICTED_PRIVACY to PLUGIN_PRIVACY
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* fix typo in PrivacyParmeters::toString
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Fix exception messages to be PrivacyPlugin
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Remove blockNumber from getPrivateTransactionFromPayload
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
* Unrestricted Privacy: implement unrestricted privacy
- put data on chain
- wire up methods for sendRaw with restriction
- unrestricted pre-compile for processing transactions at Address.precompiled(PRIVACY - 4)
- store private state of unrestricted transactions
- route priv endpoints to unrestricted state resolution
- Implement unrestricted websocket endpoint
- Tidy up web3j transaction manager naming
- Parameterize tests for different privacy restrictions
- Implement our own PrivateTransactionManager
- remove chainId from sendRawTransaction calls
- Add check for member being a participant when creating privacy group
- refactor private marker transaction naming
- mark privacy-unrestricted-enabled as beta
- Remove create privacy group from unrestricted
- Unrestricted privacy acceptance tests will use a generated group id.
- rename enclavePublicKey to privacyUserId
- Ignore some tests for unrestricted privacy
- privacyGroupId has no significant meaning in unrestricted tests
- Change config label to be inline with previous conventions
- command tests to be added when made stable
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
Signed-off-by: Stefan Pingel <stefan.pingel@consensys.net>
Co-authored-by: Stefan Pingel <stefan.pingel@consensys.net>
* don't set SECP256R1 as signature algorithm instance in the tests, only use it when the nodes are started as their own processes
Signed-off-by: Daniel Lehrner <daniel@io.builders>
* renamed some variables for better readability
Signed-off-by: Daniel Lehrner <daniel@io.builders>