Skip to content

op-e2e: action testing user#3628

Merged
mergify[bot] merged 4 commits intodevelopfrom
action-testing-user
Oct 13, 2022
Merged

op-e2e: action testing user#3628
mergify[bot] merged 4 commits intodevelopfrom
action-testing-user

Conversation

@protolambda
Copy link
Contributor

@protolambda protolambda commented Sep 30, 2022

Description

This PR introduces:

  • L1Bindings and L2Bindings: contracts backed by an ethclient and other typed client bindings for users.
  • a BasicUserEnv which holds common user environment properties (i.e. can be shared between users). This is using generics, so we can embed either L1 or L2 bindings.
  • a BasicUser actor that can make txs and randomize their tx input choices with actions.
  • a CrossLayerUser actor that has a L1 and L2 BasicUser side and combines them to enable deposits and later withdrawal actions (see Action-testing: extend user actor with withdrawal txs #3670).

Some of the actions to randomize and create tx contents are still a bit unpolished; we can fix that when when we use the User actor in more tests.

This also fixes minor bugs in action-testing:

  • The L2 engine block building wasn't preparing the state db for the tx, causing receipts to have no event logs.
  • The L1 miner had the same problem as the above.
  • The sequencer state was resetting the payload ID to zero value in the outer sequencer function, instead of the complete building function, causing it to be missed when not calling the outer function.

Tests

Create alice and make all types of transactions in very few lines of code: these actions can be reordered/repeated to build different L1/L2 chains (and we can do so with more users too).

Additional context

Some of the action functions are curried so we can make an action with the same parameters that is repeatable.

Metadata

Fix ENG-2765

@changeset-bot
Copy link

changeset-bot bot commented Sep 30, 2022

⚠️ No Changeset found

Latest commit: 750d394

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mergify
Copy link
Contributor

mergify bot commented Sep 30, 2022

This PR changes implementation code, but doesn't include a changeset. Did you forget to add one?

@protolambda protolambda marked this pull request as ready for review October 7, 2022 05:07
@protolambda protolambda changed the title op-e2e: action testing user (work in progress) op-e2e: action testing user Oct 7, 2022
Copy link
Contributor

@trianglesphere trianglesphere left a comment

Choose a reason for hiding this comment

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

This is a cool framework, but having more comments would be really helpful for understanding the actions.

Copy link
Contributor

@trianglesphere trianglesphere left a comment

Choose a reason for hiding this comment

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

lgtm

@mergify
Copy link
Contributor

mergify bot commented Oct 13, 2022

This PR has been added to the merge queue, and will be merged soon.

@mergify
Copy link
Contributor

mergify bot commented Oct 13, 2022

This PR is next in line to be merged, and will be merged as soon as checks pass.

@mergify mergify bot merged commit c930dcc into develop Oct 13, 2022
@mergify mergify bot deleted the action-testing-user branch October 13, 2022 23:00
@mergify mergify bot removed the on-merge-train label Oct 13, 2022
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.

4 participants