Skip to content
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

Add Support for Hyperledger Besu #616

Merged
merged 1 commit into from
Oct 24, 2019
Merged

Conversation

shemnon
Copy link
Contributor

@shemnon shemnon commented Oct 22, 2019

Most of the existing ethereum adapter works fine for Besu except for two
major issues: Besu does not have wallet support (and never will as an
architectual choice) and hence the automatic management of nonces no
longer works.

First, we add two new config vars contractDeployerAddressPrivateKey and
fromAddressPrivateKey and if present prefer the 'raw' transaciton APIs.

Second in the main transaction loop we track the nonce of the current
transaction so this can set the nonces appropriately.

Finally we add in gas estimation rather than a hard coded gas number
so that blocks can be as full as possible.

Besu has a slightly different genesis config from geth, so a besu config
directory in the samples is added. The samples network only uses Clique
right now because PoW is not something enterprises should be deploying.

Signed-off-by: Danno Ferrin [email protected]

Checklist

  • A link to the issue/user story that the pull request relates to
  • How to recreate the problem without the fix
  • Design of the fix
  • How to prove that the fix works
  • Automated tests that prove the fix keeps on working
  • Documentation - any JSDoc, website, or Stackoverflow answers?

Issue/User story

Steps to Reproduce

Existing issues

Design of the fix

Validation of the fix

Automated Tests

What documentation has been provided for this pull request

@nklincoln
Copy link
Contributor

@shemnon - thanks for raising the PR, at the moment the build is breaking at the license check stage ... it would appear that you need to add the besu sample to the ignore list at the package level within the caliper-samples/package.json, under the license-check-and-add-config section.

A npm run licchk should pass once the above is complete, and the build should be successful 👍

Copy link
Contributor

@aklenik aklenik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you apply my small fixes (sleep, and image tag) and run the following, it works fine:

node ../caliper-cli/caliper.js benchmark run --caliper-workspace . --caliper-benchconfig benchmark/simple/config.yaml --caliper-networkconfig network/besu/1node-clique/ethereum.json

But if you change the number of local clients to 2 in benchmark/simple/config.yaml, then it will hang after a while, the unfinished TXs won't decrease, probably because of the locally maintained nonce.

packages/caliper-ethereum/lib/ethereum.js Outdated Show resolved Hide resolved
packages/caliper-ethereum/lib/ethereum.js Outdated Show resolved Hide resolved
@aklenik
Copy link
Contributor

aklenik commented Oct 22, 2019

@shemnon I would say that leave this as it is (after fixing the license issues), and extend the Ethereum docs page with the Besu support, and note that currently only a single client is supported.
@nklincoln Do you agree with this?

@shemnon shemnon force-pushed the besu branch 2 times, most recently from c369b95 to 8ac9f7c Compare October 22, 2019 20:54
Copy link
Contributor

@aklenik aklenik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed yesterday, the Besu PRs will be merged as-is. The last thing is to squash your commits, and it's good to go 👍

Most of the existing ethereum adapter works fine for Besu except for two
major issues:  Besu does not have wallet support (and never will as an
architectual choice) and hence the automatic management of nonces no
longer works.

First, we add two new config vars contractDeployerAddressPrivateKey and
fromAddressPrivateKey and if present prefer the 'raw' transaciton APIs.

Second in the main transaction loop we track the nonce of the current
transaction so this can set the nonces appropriately.

Finally we add in gas estimation rather than a hard coded gas number
so that blocks can be as full as possible.

Besu has a slightly different genesis config from geth, so a besu config
directory in the samples is added. The samples network only uses Clique
right now because PoW is not something enterprises should be deploying.

Signed-off-by: Danno Ferrin <[email protected]>
@shemnon
Copy link
Contributor Author

shemnon commented Oct 24, 2019

squashed

@aklenik aklenik merged commit 7812efa into hyperledger-caliper:master Oct 24, 2019
@shemnon shemnon deleted the besu branch October 24, 2019 11:28
@aklenik aklenik mentioned this pull request Nov 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants