37 Commits

Author SHA1 Message Date
Cristiano Aguzzi
72ac7bdbe4 [Follow up] Add Transaction Permissioning Hook to PermissioningService Interface (#8365)
* fixing the issue of implementing the permission service class in pr when it already exists
Signed-off-by: vaidikcode <vaidikbhardwaj00@gmail.com>

* wiring transaction filtering for Permissioning Plugins

* revert modify deprated code for TransactionSmartContractPermissioning

* Improve logging for AccountPermissioningController

Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Cristiano Aguzzi <relu91@users.noreply.github.com>

* Improve logging messages for AccountPermissioningController

* Allign AccountPermissioningControllerFactoryTest with the latest api

Signed-off-by: reluc <relu.cri@gmail.com>

---------

Signed-off-by: Vaidik <vaidikbhardwaj00@gmail.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: reluc <relu.cri@gmail.com>
Signed-off-by: Cristiano Aguzzi <relu91@users.noreply.github.com>
Co-authored-by: vaidikcode <vaidikbhardwaj00@gmail.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Justin Florentine <justin+github@florentine.us>
2025-03-12 07:41:09 +00:00
Fabio Di Fabio
74929eb215 Revert "revert to unchanged plugin interface signature (#7938)" (#7977)
This reverts commit f08147acef.

# Conflicts:
#	plugin-api/build.gradle

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Co-authored-by: Justin Florentine <justin+github@florentine.us>
2024-12-03 19:13:10 +00:00
Sally MacFarlane
979ea5de74 [MINOR] (privacy deprecation) correct target to 24.12.0 (#7953) 2024-11-29 04:43:30 +00:00
Justin Florentine
f08147acef revert to unchanged plugin interface signature (#7938)
Signed-off-by: jflo <justin+github@florentine.us>
2024-11-26 17:16:09 -05:00
Sally MacFarlane
302999aa18 Privacy deprecation warnings on CLI (#7897)
* add deprecation notice to help descriptions for all privacy options

* log deprecation warning for privacy enabled options

* added @Deprecation annotations to privacy plugin classes

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

---------

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
2024-11-22 02:08:04 +00:00
Justin Florentine
c127f9c1d7 naming things is important (#7895)
BesuContext was not a helpful name for an interface that only manipulates services to be used by plugins.

---------

Signed-off-by: jflo <justin+github@florentine.us>
2024-11-20 22:23:49 +00:00
wangjingcun
3ebf50ea0b chore: fix some typos in comments (#7866)
Signed-off-by: wangjingcun <wangjingcun@aliyun.com>
2024-11-08 09:00:29 +00:00
Fabio Di Fabio
22a570eda4 Fix registering new metric categories from plugins (#7825)
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
2024-10-30 16:21:10 +01:00
Sally MacFarlane
76060a0416 [TESTING] remove junit4 dependency (#7793)
* migrate to junit5
* remove junit4 dep
* remove vintage dep

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

---------

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
2024-10-23 07:52:51 +10:00
Gabriel-Trintinalia
e0518c6d94 Force besu to stop on plugin initialization errors (#7662)
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
2024-09-24 10:50:19 +00:00
Matilda-Clerke
da98fa5541 Reintroduce engine get client version v1 with commit in manifest (#7548)
* Include Commit-Hash in manifests
* Add commit method in BesuInfo
* Use 8 character hash in EngineGetClientVersionV1 and revert calculateVersion back to original spec

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>
Co-authored-by: garyschulte <garyschulte@gmail.com>
2024-08-30 18:13:53 +00:00
Gabriel-Trintinalia
d7041d4221 CLI option for disabling auto-registration of external plugins (#7470)
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
2024-08-16 15:09:31 +10:00
Fabio Di Fabio
a7ab1773e4 In process RPC service (#7395)
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
2024-07-31 16:46:16 +00:00
Usman Saleem
9d92ae87df feat: Expose set finalized/safe block in plugin-api BlockchainService (#7382)
* feat: Expose set finalized and safe block in plugin-api BlockchainService
* check for poa network before setting finalized block
* changelog
* Add BlockchainService set finalized acceptance test

---------

Signed-off-by: Usman Saleem <usman@usmans.info>
2024-07-31 15:39:44 +00:00
Usman Saleem
f0cb26eb31 Enable spotless license header check (#7040)
* Enable spotless license header

Signed-off-by: Usman Saleem <usman@usmans.info>

* Apply spotless license header

Signed-off-by: Usman Saleem <usman@usmans.info>

---------

Signed-off-by: Usman Saleem <usman@usmans.info>
2024-05-03 01:38:42 +00:00
Usman Saleem
07765b57a8 build - Update license headers formatting (2) (#7016)
* Preparing spotless license header option and adding license templates

---------

Signed-off-by: Usman Saleem <usman@usmans.info>
2024-04-30 23:53:13 +00:00
Gabriel-Trintinalia
a1f73d925e Enhanced control over plugins registration (#6700)
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
2024-04-19 16:38:35 +00:00
Sally MacFarlane
4bc04b2939 junit 5 (#6256)
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
2023-12-11 12:58:40 +10:00
Daniel Lehrner
1a087709ac Extend OperationTracer with new methods (#5662)
* Extend OperationTracer with new methods, create

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* Rename ExtendedOperationTracer to BlockAwareOperationTracer

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* fixed plugin api hash

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* added missing javadoc comments

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* Update evm/src/main/java/org/hyperledger/besu/evm/tracing/OperationTracer.java

Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* Only update peer with the first and last block (#5659)

* only update peer with the first and last block

Signed-off-by: Stefan <stefan.pingel@consensys.net>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* Put download links into CHANGELOG and do some clean up (#5660)

* put the download links for 23.4.4 into the CHANGELOG.md
* clean up CHANGELOG

Signed-off-by: Stefan <stefan.pingel@consensys.net>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* Add --amend to docker manifest create to fix docker latest tag (#5661)

We need to replace previous release's latest tag. Might be broken due to a recent change in the docker command implementation
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* Add Xlayered-tx-pool to the config log printout (#5665)

Unrelated: clarify epoch length in javadoc

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Co-authored-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* Add hooks to AbstractCreateOperation for library users (#5656)

Add hooks for a successful contract create, a failed contract create,
and an invalid contact create. Users of the library will be able to
customize create responses without having to replace core logic.

Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* Test updates for cancun execution-spec-tests (#5670)

- support legacy V values (larger V value) and type 1+ (v is recId only)
- new fields
- shared transaction extraction
- rejection detection

Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* Upgrade BouncyCastle libraries (#5675)

Upgrade bouncy castle to v1.75.  This involved a change in maven
coordinates for other modules.

Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* Introduce transaction validator interface (phase 1) (#5673)

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* Only validate `--miner-enabled` option for ethash networks (#5669)

* Modify the min-gas-price option validation
* Check for whether ethash is in use, either from genesis or network config, and use that for miner checks
* Add genesis configuration isPoa() convenience function

---------

Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
Signed-off-by: Matt Whitehead <matthew1001@hotmail.com>
Co-authored-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by:  Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* Update tuweni2.4.2 (#5684)

* Revert "Revert "Update Tuweni to 2.4.1 (#5513)" (#5585)"

This reverts commit 6111e1bbc3.

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>

* update Tuweni to 2.4.2

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>

---------

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* Do not leak references to PendingTransactions (#5693)

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* remove v0 version of the database (#5698)

Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* updated plugin api hash

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* spotless

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* updating plugin api hash

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* moved transcation interface to datatypes to use it in the OperationTracer.traceStartTransaction method

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* fix import

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

---------

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Signed-off-by: Stefan <stefan.pingel@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
Signed-off-by: Matt Whitehead <matthew1001@hotmail.com>
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Stefan Pingel <16143240+pinges@users.noreply.github.com>
Co-authored-by: Simon Dudley <simon.dudley@consensys.net>
Co-authored-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Co-authored-by: Danno Ferrin <danno.ferrin@gmail.com>
Co-authored-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Co-authored-by: Matt Whitehead <matthew1001@gmail.com>
Co-authored-by: Antoine Toulme <antoine@lunar-ocean.com>
Co-authored-by: matkt <karim.t2am@gmail.com>
2023-07-20 13:17:24 +02:00
Stefan Pingel
534a369574 Move connect decision into protocol layer (#4759)
Move the decision making for connecting or not connecting to peers into the eth layer. Future changes will take advantage if this to improve peering.

Signed-off-by: Stefan <stefan.pingel@consensys.net>

---------

Signed-off-by: Stefan <stefan.pingel@consensys.net>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
2023-04-14 09:28:29 +10:00
Danno Ferrin
ebbc0df773 Reduce EVM module dependencies (#5285)
Refactor crypto, datatypes, and plugin-api to reduce plugin APIs in the EVM.

Split crypto into crypto services and crypto algorithms
Reverse the dependency between datatyps and plugin-api.
Remove plugin Hash and Address types (use datatypes)
Move PublicKey and Quantity into datatypes.

Lots of changes to imports and build files, and some fromPlugin calls removed.

Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
Signed-off-by: Danno Ferrin <danno.ferrin@shemnon.com>
Co-authored-by: Justin Florentine <justin+github@florentine.us>
2023-03-30 18:34:37 -05:00
Sally MacFarlane
056e911f8f constants for namespace values (#5203)
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
2023-03-13 13:59:58 +10:00
Sally MacFarlane
c9de473a3c kubernetes and errorprone - update versions (#5013)
* update errorprone and kubernetes versions
* fixed errorprone issues in prod cod
* fixed errorprone issues in test code

---------

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
2023-02-01 10:42:36 +10:00
Danno Ferrin
6f20060182 Rollback #4578 and #44562 (#4583)
Due to subtle differences between Bytes32 and UInt256 the changes failed
burn-in testing and are being reverted.

Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>

Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
2022-11-01 14:53:01 +10:00
Danno Ferrin
b322ef6ae1 Migrate storage APIs to Bytes32 (#4562)
The current internal storage APIs implement UInt256 rather than Bytes32,
which is an accident of prior EVM design.  This migrates all internal
handling of storage addresses and values to Bytes32.

The main performance gain is reduced GC pressure, in that UInt256 
stores the data as an array of ints, whereas Bytes32 keeps a sliced or
wrapped array of bytes. Since database APIs are all byte array based 
this should remove unneeded conversions when going to/from the DB.

Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
2022-10-28 11:35:09 -05:00
Danno Ferrin
755771d22c Dependency Version Updates for 22.7.0-RC1 (#4004)
Update dependency versions.

Dependencies skipped because they require compatibility work
 * vertx
 * JMH
 * Prometheus
 * RocksDB
 * Web3j
 * Gradle

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
2022-06-23 11:03:07 -03:00
Danno Ferrin
b4027d6e39 Use JUnit 5 for unit test execution (#3620)
Change the unit test execution to use the Junit5 JUnitPlatform. This
allows for a mix of junit 4 and junit 5 tests and for a gradual
migration to junit 5 instead of a big bang. One class depended on
junit 4 exceptions and was updated. Two tests depending on 
native libraries fail gracefully on mac (and only mac).

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
2022-04-02 00:34:48 +10:00
Diego López León
ed1329cf84 Introduce SLF4J for logging (#3285)
* Bump SLF4J version

Signed-off-by: Diego López León <dieguitoll@gmail.com>

* Replace log4j2 API with SLF4j API

Signed-off-by: Diego López León <dieguitoll@gmail.com>

* Replace usage of LogManager#getFormatterLogger

This is for keeping compatibility with SLF4J. If neccesary, a specific formatter can be created for the RlpBlockImporter class

Signed-off-by: Diego López León <dieguitoll@gmail.com>

* Unset the default logging value for the retesteth

This is because it's not possible to resolve the root logger level into a Log4J2 field

Signed-off-by: Diego López León <dieguitoll@gmail.com>

* Prevent creation of Logger context outside SLF4J

org.hyperledger.besu.cli.BesuCommand#setAllLevels was taken from
https://github.com/apache/logging-log4j2/blob/rel%2F2.17.1/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java#L309

Signed-off-by: Diego López León <dieguitoll@gmail.com>

* Add FATAL level deprecation message

Signed-off-by: Diego López León <dieguitoll@gmail.com>

* [Sonar] Fix java:S2139

Exceptions should be either logged or rethrown but not both

Signed-off-by: Diego López León <dieguitoll@gmail.com>

* [Sonar] Fix java:S3457

Printf-style format strings should be used correctly

Signed-off-by: Diego López León <dieguitoll@gmail.com>

* Add changelog

Signed-off-by: Diego López León <dieguitoll@gmail.com>
2022-01-25 20:14:54 -03:00
Antony Denyer
424de5a55b Start external services before we start plugins (#3118)
* Start external services before we start mining

Reasons:

- you may wish to query the blockchain using rpc before you start
  processing

- you may wish to register a websocket e.g to listen for blocks
  currently you will probably miss one because we start processing
  before we start the ws service

Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>

* Add beforeExternalServices hook for plugins

Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>

* move the acceptance test plugins

move the test plugins that are used in the acceptance tests into the same
package namespace as the acceptance tests so that they are ignored by
sonar for code coverage

Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>

* Fix typo in log

Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>

Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
2021-12-20 15:59:33 +10:00
Antony Denyer
99a495275d Move plugin validation to happen after startPlugins (#2957)
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
2021-11-04 10:47:52 +00:00
Antony Denyer
a30c314290 Allow Besu to host RPC endpoints via a plugin. (#2754)
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>
2021-10-11 09:45:52 +01:00
Danno Ferrin
2abc7074bb Create new datatypes module for Address, Hash, and Wei (#2779)
* 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>
2021-09-20 14:08:09 -06:00
Danno Ferrin
367b6a74f1 Remove EIP-1702 account versioning (#2657)
EIP-1702 account versioning was a candidate for the Istanbul hard fork 
but was removed prior to the first testnet. Other versioning techniques 
have greater core dev mind share and one preparatory step landed in 
London, EIP-3541, making EIP-1702 very unlikely to make it to Mainnet.

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
2021-08-19 15:58:27 +10:00
Antony Denyer
19c34514a1 [Privacy] Allow users to provide a private genesis (#2509)
* 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>
2021-08-10 09:38:57 +01:00
Antony Denyer
41521b6c03 Privacy plugin pmt factory (#2557)
* 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>
2021-07-28 18:27:36 +01:00
Antony Denyer
ffc22522f8 Privacy payload plugin (#2377)
* 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>
2021-07-12 17:02:04 +10:00
Antony Denyer
840d364659 PermissioningService Besu Plugin (#2218)
* Permissioning: Add plugin extension point

Added plugin extension point to allow developers to write their
own implementation of `NodePermissioningProvider::isPermitted`

This will allow developers to implement their own interpretations of
things like on-chain permissioning.

Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>

* refactor: rename NodePermissioningProvider::isPermitted

Interface will be used for other pemissioning needs

Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>

* Permissioning: added hook for NodeMessagePermissioning

All message sent to a peer will call into isMessagePermitted
if providers have been registered through the plugin api

Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>

* AcceptanceTests: test node nodePermissioningProvider

4 node cluster with permissioning blocking a direct between two nodes
and permissioning blocking transaction messages for a single node

Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>

* fix: unit tests for NodePermissioningControllerFactory

Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>

* fix: fat finger typo

Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>

* fix: reduce likely hood of flakey test

Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>

* fix: remove comment

Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>

* fix: typos

Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>

* fix: remove jitpack references

Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>

* fix: tidy up EthPeerTest args

Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>

* fix: update plugin hash check

Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>

* fix: improve test reliability

Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>

* refactor: move test-plugins out from besu/main into acceptance-tests

Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
2021-05-17 10:30:49 +10:00