-
Notifications
You must be signed in to change notification settings - Fork 779
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 backwards-compatibility test fixture and run in CI for tx
#1118
Conversation
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. |
3e0ee6a
to
3431bae
Compare
In this CI run a "verification" log line is injected into the npm sourced package's Transaction constructor (before swapping) to demonstrate that the substitution takes place as expected. |
Great, generally stay in close sync with @jochem-brouwer on this, still not sure if this will be necessary on this round or if #1048 will stay generally backwards-compatible, but independently from that it's great to have this, we'll see if it comes to application directly. One question I have is how to solve the TypeScript signature typing for txs elegantly so that |
Rebased |
This test sort of works... Maybe this line should get an explicit cast to ethereumjs-monorepo/packages/vm/lib/runTx.ts Line 102 in 5620105
- if (opts.tx.transactionType === 1 && this._common.isActivatedEIP(2929)) {
+ if ((opts.tx as EIP2930Transaction).transactionType === 1 && this._common.isActivatedEIP(2929)) { A more correct version of this test might look like the setup in #1134 and a simple mock project whose dependencies are:
...with tests similar to Seems like the implementation is pretty non-breaking to me though... |
A cast wouldn't work here, since this actually should work without this being an |
Am going to close here and pursue my suggestion for a more realistic test above as part of reviewing #1138. This test isn't designed correctly. |
Since we now already have two use cases for this (testing the tx-related VM methods, testing the Not sure, just a thought, if it gets too complicated definitely also viable to copy-paste e.g. some GH actions code from one actions file to another or something. |
#1111
This PR's strategy is to swap an npm published version of a sub-dependency (ex:
tx
) into the monorepo, replacing the current branch's version. Then everything is re-linked and vm API tests are run with the new version.Have added a shell script that can execute this process generically for any sub-dependency/target pair. It restores the monorepo to its original state after executing so in principle it can be used locally but have added an env variable safety check to dissuade people from doing this accidentally.
It should also be possible to execute repeatedly in CI in the
vm-backwards-compatibility
job for different subpackages (mpt, etc)Usage:
The script flow for this case is
packages/tx
to a safe place (stash/
)tx
folder in the project root, cd in and npm install @ethereumjs/tx theretx/node_modules/@ethereumjs/tx
out 2 levels so that the folder looks liketx/
intopackages/