* reduce use of global quorum config
The use of the org.hyperledger.besu.config.GoQuorumOptions static
variable is ugly. In particular does changing its value during tests
cause flaky tests. To ameliorate the issue this commit
- removes unused code that did rely on GoQuorumOptions
- removes access to GoQuorumOptions deep in the call stack by looking
it up in the transaction validator instead
- change the TransactionDecoder to explicitly take the
goQuorumCompatbility flag as an argument where access to the
transaction validator is not easy
- rewriting all tests that did change the GoQuorumOptions by mocking
the option change instead.
Signed-off-by: Taccat Isid <taccatisid@protonmail.com>
* protect access to GoQuorum flag by getter and write once setter
Signed-off-by: Taccat Isid <taccatisid@protonmail.com>
* deduce goQuorum flag from privacyOptions
Signed-off-by: Taccat Isid <taccatisid@protonmail.com>
* remove unnecessary mocks from TransactionPoolTest
Signed-off-by: Taccat Isid <taccatisid@protonmail.com>
Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
More EVM Speed Improvements aimed at improving MSTORE times.
* Move Memory from raw bytes to byte array
* Add calls for right packed partial value copy
* Remove `incrementProgramCounter` and move data into OperationResult
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Before we set the account balance to maximum allowed, but this had
side effects in smart contracts.
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Create readOnlyValidatorProvider in QbftBesuControllerBuilder and pass into QbftJsonRpcMethods constructor (better than using protocolContext as is only used once when creating the RPCs
This requires storing transactionValidatorProvider in a field and relying on its earlier creation during createConsensusContext()
Fixes#2795
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Always copy create code
Always copy the create code. Since it is memory bytes it is subject to
re-writing by the caller and all data would otherwise have to be treated
as mutable.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
During the transition from contract mode to block header mode, when creating the extra data for a new block, we need to look ahead to the next block's voteProvider to obtain the nonEmpty one associated with the BlockValidatorProvider.
This only applies to ForkingValidatorProvider which is currently only used for QBFT. However, we don't want QBFT to know it's using a ForkingValidatorProvider. Therefore we need to implement getVoteProviderAfterBlock on the ValidatorProvider interface even though it's implementation is equivalent to getVoteProvider.
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
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>
QBFT to log warning when using validator contract if genesis extra data has validator
Also prevent existing warning from logging when using validator contract with no signers in genesis extra data.
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
* Extract private key file option to mixin (#536)
Signed-off-by: Diego López León <dieguitoll@gmail.com>
* Method rename (#536)
Signed-off-by: Diego López León <dieguitoll@gmail.com>
* Use keypair to resolve node key in public-key subcommands (#536)
Signed-off-by: Diego López León <dieguitoll@gmail.com>
* Refactor common behavior for public key subcommands (#536)
Signed-off-by: Diego López León <dieguitoll@gmail.com>
* Write test private key to default location (#536)
This is to rely on actual file system resolution for the test context
Signed-off-by: Diego López León <dieguitoll@gmail.com>
* Add support for custom private key file on public-key subcommands (#536)
Signed-off-by: Diego López León <dieguitoll@gmail.com>
Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
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>