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

Adjust e2e transfer and governance tests to match new fee distribution and eliminate ProposerFraction #1585

Merged
merged 34 commits into from
Nov 13, 2019

Conversation

nategraf
Copy link
Contributor

@nategraf nategraf commented Nov 5, 2019

Description

Fee distribution updated in celo-org/celo-blockchain#563 requires updates to the e2e transfer test. This PR provides those changes.

Tested

Tested with e2e and existing unit tests.

Other changes

  • Only restart the geth nodes between different sync options to avoid a fragile test condition in which we only test transfers from a fresh state.
  • Shorten the delay on waiting for the sync node to update.
  • Check gas usage on test transfers, because the tests may erroneous pass or fail a test condition if the gas usage changes without the test being updated.

Related issues

Backwards compatibility

Introduces a breaking change to contract kit by removing proposer fraction. Test changes are compatible with blockchain clients which include celo-org/celo-blockchain#563

Depends on celo-org/celo-blockchain#563

@nategraf
Copy link
Contributor Author

nategraf commented Nov 5, 2019

Marking do not merge until celo-org/celo-blockchain#563 is merged

@codecov
Copy link

codecov bot commented Nov 5, 2019

Codecov Report

Merging #1585 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1585   +/-   ##
=======================================
  Coverage   74.45%   74.45%           
=======================================
  Files         279      279           
  Lines        7582     7582           
  Branches      664      664           
=======================================
  Hits         5645     5645           
  Misses       1823     1823           
  Partials      114      114
Flag Coverage Δ
#mobile 74.45% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9f4c083...8c57bbc. Read the comment docs.

@nategraf nategraf changed the title Adjust e2e transfer test to match new fee distribution and eliminate ProposerFraction Adjust e2e transfer and governance tests to match new fee distribution and eliminate ProposerFraction Nov 5, 2019
Copy link
Contributor

@asaj asaj left a comment

Choose a reason for hiding this comment

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

Looks great! Mostly nits

@@ -522,7 +522,7 @@ jobs:
command: |
set -e
cd packages/celotool
./ci_test_transfers.sh checkout master
./ci_test_transfers.sh checkout victor/gpm
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm still not convinced it's better to repoint both PRs instead of just repointing one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My intention is to merge celo-org/celo-blockchain#563, point this back to master, wait for CI to pass, then merge this one. I simply want to see that the e2e tests pass (or fail) on this PR while the other is still pending.

packages/celotool/src/e2e-tests/governance_tests.ts Outdated Show resolved Hide resolved
packages/celotool/src/e2e-tests/transfer_tests.ts Outdated Show resolved Hide resolved
@@ -442,8 +443,8 @@ describe('Transfer tests', function(this: any) {
before(`start geth on sync: ${syncMode}`, () => startSyncNode(syncMode))

describe('Transfer CeloGold >', () => {
const GOLD_TRANSACTION_GAS_COST = 29180
describe('gasCurrency = CeloGold >', () => {
const GOLD_TRANSACTION_GAS_COST = 30005
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was out of date and being ignored. I adjusted each of the gas costs based on master then added a step step to enforce that they are accurate.

packages/celotool/src/e2e-tests/transfer_tests.ts Outdated Show resolved Hide resolved
expectedGas: 189456,
// TODO(nategraf): Initializing a stable token account costs 5k additional gas.
// The first time this transfer is done, which is for the full node, this will be seen.
expectedGas: syncMode === 'full' ? 190303 : 175303,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we restart with clean nodes so we don't have this funky check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Restarting with clean nodes takes longer and reduces test coverage because it only considers transfers to fresh accounts. I'll go ahead and split this off into it's own test case though.

@asaj asaj assigned nategraf and unassigned timmoreton Nov 6, 2019
@nategraf nategraf added automerge Have PR merge automatically when checks pass and removed do not merge labels Nov 13, 2019
@celo-ci-bot-user celo-ci-bot-user merged commit 413739b into master Nov 13, 2019
@celo-ci-bot-user celo-ci-bot-user deleted the victor/gpm branch November 13, 2019 23:51
aaronmgdr added a commit that referenced this pull request Nov 14, 2019
* master: (56 commits)
  Adjust e2e transfer and governance tests to match new fee distribution and eliminate ProposerFraction (#1585)
  [Wallet] Add more local currencies (#1698)
  Switch to correct cluster when fauceting (#1687)
  [Wallet] Use the country of the phone number for determining the default local currency (#1684)
  [Wallet] Limit QR code scanner to 1 code per second (#1676)
  Update Dark backgrounds text color (#1677)
  Remove integration sync test
  Minor attestation service fixes (#1680)
  [wallet] Fixed Native phone picker Use native API instead (#1669)
  Fix token addresses for notification service (#1674)
  Add golang to setup docs
  [wallet] Hide invite education copy after invite was redeemed (#1670)
  [Wallet] Add spinner, timer, and tip text to Verification input screen (#1656)
  [Wallet] Fix app deprecation check mechanism (#1358)
  Point end-to-end governance test back to master (#1665)
  Add EpochRewards smart contract to calculate epoch rewards and payments (#1558)
  Optimized Attestation view calls and removal of the reveal TX (#1578)
  Support claim signatures and support Keybase claims (#1575)
  [Wallet] Add timestamp to top banner messages (#1657)
  Export geth metrics on VM testnet (#1351)
  ...

# Conflicts:
#	yarn.lock
@nategraf nategraf restored the victor/gpm branch November 14, 2019 18:18
aaronmgdr added a commit that referenced this pull request Nov 14, 2019
* master:
  Adjust e2e transfer and governance tests to match new fee distribution and eliminate ProposerFraction (#1585)
  [Wallet] Add more local currencies (#1698)
  Switch to correct cluster when fauceting (#1687)
  [Wallet] Use the country of the phone number for determining the default local currency (#1684)
  [Wallet] Limit QR code scanner to 1 code per second (#1676)
  Update Dark backgrounds text color (#1677)
  Remove integration sync test
  Minor attestation service fixes (#1680)
  Add golang to setup docs
aaronmgdr added a commit that referenced this pull request Nov 15, 2019
* master: (81 commits)
  Make styling more consistent in validator quick start and add password prompt to account:unlock (#1731)
  New Version for contractkit (#1727)
  Remove end-to-end attestations test from circle (#1739)
  Added helper function to get the list of current validators (#1713)
  Fix flaky end-to-end transfer, protocol unit tests (#1734)
  Add AccountClaim to Metadata (#1663)
  [Wallet] Set default gradle properties (#1629)
  Update genesis block after adding parent signatures to block header (#1732)
  Removed end-to-end-geth-integration-sync-test job in workflow (#1730)
  Change the event we emit when selecting issuers (#1706)
  [Wallet] Prompt user to restart app when turning off Forno a second time (#1708)
  Check in spanish verification translations (#1726)
  [Wallet] Style fixes on iOS for verification and backup flows (#1718)
  [Wallet] Reset isRedeemingInvite on rehydrate (#1716)
  Adjust e2e transfer and governance tests to match new fee distribution and eliminate ProposerFraction (#1585)
  [Wallet] Add more local currencies (#1698)
  Switch to correct cluster when fauceting (#1687)
  [Wallet] Use the country of the phone number for determining the default local currency (#1684)
  [Wallet] Limit QR code scanner to 1 code per second (#1676)
  Update Dark backgrounds text color (#1677)
  ...

# Conflicts:
#	packages/web/pages/_app.tsx
#	packages/web/src/dev/BuildPage.tsx
#	packages/web/src/dev/Cover.tsx
#	packages/web/src/dev/StackSection.tsx
#	yarn.lock
aaronmgdr added a commit that referenced this pull request Nov 26, 2019
* master: (70 commits)
  Make styling more consistent in validator quick start and add password prompt to account:unlock (#1731)
  New Version for contractkit (#1727)
  Remove end-to-end attestations test from circle (#1739)
  Added helper function to get the list of current validators (#1713)
  Fix flaky end-to-end transfer, protocol unit tests (#1734)
  Add AccountClaim to Metadata (#1663)
  [Wallet] Set default gradle properties (#1629)
  Update genesis block after adding parent signatures to block header (#1732)
  Removed end-to-end-geth-integration-sync-test job in workflow (#1730)
  Change the event we emit when selecting issuers (#1706)
  [Wallet] Prompt user to restart app when turning off Forno a second time (#1708)
  Check in spanish verification translations (#1726)
  [Wallet] Style fixes on iOS for verification and backup flows (#1718)
  [Wallet] Reset isRedeemingInvite on rehydrate (#1716)
  Adjust e2e transfer and governance tests to match new fee distribution and eliminate ProposerFraction (#1585)
  [Wallet] Add more local currencies (#1698)
  Switch to correct cluster when fauceting (#1687)
  [Wallet] Use the country of the phone number for determining the default local currency (#1684)
  [Wallet] Limit QR code scanner to 1 code per second (#1676)
  Update Dark backgrounds text color (#1677)
  ...
@mcortesi mcortesi deleted the victor/gpm branch December 4, 2019 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Have PR merge automatically when checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants