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

chore(deps): update dependency @ethereumjs/tx to v5 #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Aug 9, 2023

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@ethereumjs/tx (source) ^4.0.0 -> ^5.0.0 age adoption passing confidence

Release Notes

ethereumjs/ethereumjs-monorepo (@​ethereumjs/tx)

v5.4.0: @​ethereumjs/tx v5.4.0

Compare Source

EOA Code Transaction (EIP-7702) (outdated)

This release introduces support for a non-final version of EIP-7702 EOA code transactions, see PR #​3470. This tx type allows to run code in the context of an EOA and therefore extend the functionality which can be "reached" from respectively integrated into the scope of an otherwise limited EOA account.

The following is a simple example how to use an EOACodeEIP7702Transaction with one autorization list item:

// ./examples/EOACodeTx.ts

import { Chain, Common, Hardfork } from '@​ethereumjs/common'
import { EOACodeEIP7702Transaction } from '@​ethereumjs/tx'
import type { PrefixedHexString } from '@​ethereumjs/util'

const ones32 = `0x${'01'.repeat(32)}` as PrefixedHexString

const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Cancun, eips: [7702] })
const tx = EOACodeEIP7702Transaction.fromTxData(
  {
    authorizationList: [
      {
        chainId: '0x1',
        address: `0x${'20'.repeat(20)}`,
        nonce: ['0x1'],
        yParity: '0x1',
        r: ones32,
        s: ones32,
      },
    ],
  },
  { common }
)

console.log(
  `EIP-7702 EOA code tx created with ${tx.authorizationList.length} authorization list item(s).`
)

Note: Things move fast with EIP-7702 and the released implementation is based on this commit and therefore already outdated. An up-to-date version will be released along our breaking release round planned for early September 2024.

Verkle Updates
  • Update kzg-wasm to 0.4.0, PR #​3358
  • Shift Verkle to osaka hardfork, PR #​3371
Other Features
  • Extend BlobEIP4844Transaction.networkWrapperToJson() to also include the 4844 fields, PR #​3365
  • Stricter prefixed hex typing, PRs #​3348, #​3427 and #​3357 (some changes removed in PR #​3382 for backwards compatibility reasons, will be reintroduced along upcoming breaking releases)
Bugfixes
  • Fix bug in generic error message regarding chain ID reporting, PR #​3386

v5.3.0: @​ethereumjs/tx v5.3.0

Compare Source

Full 4844 Browser Readiness
WASM KZG

Shortly following the "Dencun Hardfork Support" release round from last month, this is now the first round of releases where the EthereumJS libraries are now fully browser compatible regarding the new 4844 functionality, see PRs #​3294 and #​3296! 🎉

Our WASM wizard @​acolytec3 has spent the last two weeks and created a WASM build of the c-kzg library which we have released under the kzg-wasm name on npm (and you can also use independently for other projects). See the newly created GitHub repository for some library-specific documentation.

This WASM KZG library can now be used for KZG initialization (replacing the old recommended c-kzg initialization), see the respective README section from the tx library for usage instructions (which is also accurate for the other using upstream libraries like block or EVM).

Note that kzg-wasm needs to be added manually to your own dependencies and the KZG initialization code needs to be adopted like the following (which you will likely want to do in most cases, so if you deal with post Dencun EVM bytecode and/or 4844 blob txs in any way):

import { loadKZG } from 'kzg-wasm'
import { Chain, Common, Hardfork } from '@​ethereumjs/common'

const kzg = await loadKZG()

// Instantiate `common`
const common = new Common({
  chain: Chain.Mainnet,
  hardfork: Hardfork.Cancun,
  customCrypto: { kzg },
})

Manual addition is necessary because we did not want to bundle our libraries with WASM code by default, since some projects are then prevented from using our libraries.

Note that passing in the KZG setup file is not necessary anymore, since this is now defaulting to the setup file from the official KZG ceremony (which is now bundled with the KZG library).

Trie Node.js Import Bug

Since this fits well also to be placed here relatively prominently for awareness: we had a relatively nasty bug in the @ethereumjs/trie library with a Node.js web stream import also affecting browser compatibility, see PR #​3280. This bug has been fixed along with these releases and this library now references the updated trie library version.

v5.2.1: @​ethereumjs/tx v5.2.1

Compare Source

  • Hotfix release adding a missing debug dependency to the @ethereumjs/trie package (dependency), PR #​3271

v5.2.0

Compare Source

Dencun Hardfork Support

While all EIPs contained in the upcoming Dencun hardfork run pretty much stable within the EthereumJS libraries for quite some time, this is the first release round which puts all this in the official space and removes "experimental" labelling preparing for an imminent Dencun launch on the last testnets (Holesky) and mainnet activation! 🎉

Dencun hardfork on the execution side is called Cancun and can be activated within the EthereumJS libraries (default hardfork still Shanghai) with a following common instance:

import * as kzg from 'c-kzg'
import { Common, Chain, Hardfork } from '@​ethereumjs/common'
import { initKZG } from '@​ethereumjs/util'

initKZG(kzg, __dirname + '/../../client/src/trustedSetups/official.txt')
const common = new Common({
  chain: Chain.Mainnet,
  hardfork: Hardfork.Cancun,
  customCrypto: { kzg: kzg },
})
console.log(common.customCrypto.kzg) // Should print the initialized KZG interface

Note that the kzg initialization slightly changed from previous experimental releases and a custom KZG instance is now passed to Common by using the customCrypto parameter, see PR #​3262.

At the moment using the Node.js bindings for the c-kzg library is the only option to get KZG related functionality to work, note that this solution is not browser compatible. We are currently working on a WASM build of that respective library. Let us know on the urgency of this task! 😆

While EIP-4844 - activating shard blob transactions - is for sure the most prominent EIP from this hardfork, enabling better scaling for the Ethereum ecosystem by providing cheaper block space for L2s, there are in total 6 EIPs contained in the Dencun hardfork. The following is an overview of which EthereumJS libraries mainly implement the various EIPs:

  • EIP-1153: Transient storage opcodes (@ethereumjs/evm)
  • EIP-4788: Beacon block root in the EVM (@ethereumjs/block, @ethereumjs/evm, @ethereumjs/vm)
  • EIP-4844: Shard Blob Transactions (@ethereumjs/tx, @ethereumjs/block, @ethereumjs/evm)
  • EIP-5656: MCOPY - Memory copying instruction (@ethereumjs/evm)
  • EIP-6780: SELFDESTRUCT only in same transaction (@ethereumjs/vm)
  • EIP-7516: BLOBBASEFEE opcode (@ethereumjs/block, @ethereumjs/evm)
WASM Crypto Support

With this release round there is a new way to replace the native JS crypto primitives used within the EthereumJS ecosystem by custom/other implementations in a controlled fashion, see PR #​3192.

This can e.g. be used to replace time-consuming primitives like the commonly used keccak256 hash function with a more performant WASM based implementation, see @ethereumjs/common README for some detailed guidance on how to use.

New addSignature() API Method

There is a new dedicated method addSignature() introduced for all tx types which allows to add the raw signature values to a transaction without the need to call into tx.sign(), which would need a private key to do so, see PR #​3238.

This functionality is e.g. handy for hardware wallet implementations where the signature generation is taking place externally.

Self-Contained (and Working 🙂) README Examples

All code examples in EthereumJS monorepo library README files are now self-contained and can be executed "out of the box" by simply copying them over and running "as is", see tracking issue #​3234 for an overview. Additionally all examples can now be found in the respective library examples folder (in fact the README examples are now auto-embedded from over there). As a nice side effect all examples are now run in CI on new PRs and so do not risk to get outdated or broken over time.

v5.1.0: @​ethereumjs/tx v5.1.0

Compare Source

More Type-Aligned Library Structure

This release gently introduces a backwards-compatible new/adopted library structure which is more aligned with the idea of independent tx types, bundling various functionalities together in a way that is not necessarily hierarchical, see PR #​2993 and #​3010.

Reused functionality (e.g. calculating the upfront-cost (getUpfrontCost()) of an EIP-1559-compatible tx - is internally bundled in capability files (e.g. capabilities/eip1559.ts), which provide static call access to the respective methods.

These methods are then called and the functionality exposed by the respective methods in the tx classes, see the following example code for an FeeMarketEIP1559Transaction:

getUpfrontCost(baseFee: bigint = BigInt(0)): bigint {
    return EIP1559.getUpfrontCost(this, baseFee)
  }

This makes creating additional or custom tx types and reusing of existing functionality substantially easier and makes the library substantially more robust by largely consolidating previously redundant code parts.

Dencun devnet-11 Compatibility

This release contains various fixes and spec updates related to the Dencun (Deneb/Cancun) HF and is now compatible with the specs as used in devnet-11 (October 2023).

  • Update peer dependency for kzg module to use the official trusted setup for mainnet, PR #​3107
Other Changes
  • Performance: cache tx sender to avoid redundant and costly ecrecover calls, PR #​2985
  • Add new method getDataFee() to BlobEIP4844Transaction, PR #​2955

v5.0.0: @​ethereumjs/tx v5.0.0

Compare Source

Final release version from the breaking release round from Summer 2023 on the EthereumJS libraries, thanks to the whole team for this amazing accomplishment! ❤️ 🥳

See RC1 release notes for the main change description.

Following additional changes since RC1:

v4.2.0: @​ethereumjs/tx v4.2.0

Compare Source

This release is part of a final planned release round for the current major EthereumJS release versions, with next major versions planned to be released in July 2023.

It mainly removes all non-final EIP-4844, KZG and SSZ code from the libraries (mainly block, tx, util, evm, vm, blockchain) - see PR #​2721 - to allow for a clean slate for the current major versions to transition to maintenance mode. In particular the @chainsafe/ssz dependency is removed from the @ethereumjs/util library, which is a dependency of all other upstream EthereumJS libraries and removal therefore makes the whole stack lighter again.

If you are interested in continuously following EIP-4844 work have a look at and follow our upcoming breaking releases where major changes will be integrated with 4844 nearing a final state.

Other Changes:

  • Fix EIP-155 transaction encoding on chain ID 0 for legacy txs, PR #​2671

v4.1.2: @​ethereumjs/tx v4.1.2

Compare Source

Features
  • Add allowUnlimitedInitcodeSize option to partially disable EIP-3860, PR #​2594
  • Better Optimism RPC compatibility, new TransactionFactory.fromRPCTx() static constructor, PR #​2613
Bugfixes
  • Fixed EIP-3860 (max init code size) check when deserializing RLPs, PR #​2601
  • EIP-3860: only check max init code size on create contract tx, PR #​2575
Maintenance
  • Removed Ethers dependency, alternative fromEthersProvider() static constructor implementation, PR #​2633
  • Bump @ethereumjs/util @chainsafe/ssz dependency to 0.11.1 (no WASM, native SHA-256 implementation, ES2019 compatible, explicit imports), PRs #​2622, #​2564 and #​2656
  • Update ethereum-cryptography from 1.2 to 2.0 (switch from noble-secp256k1 to noble-curves), PR #​2641

v4.1.1: - Stable Istanbul Support

Compare Source

First stable Istanbul release passing all StateTests and BlockchainTests from the official Ethereum test suite v7.0.0-beta.1. Test suite conformance have been reached along work on PR #​607 (thanks @​s1na!) and there were several fixes along the way, so it is strongly recommended that
you upgrade from the first beta Istanbul release v4.1.0.

Istanbul Related Fixes

  • Refund counter has been moved from the EEI to the EVM module, PR #​612, gasRefund is re-added to the execResult in the EVM module at the end of message execution in EVM to remain (for the most part) backwards-compatible in the release
  • Fixed blake2f precompile for rounds > 0x4000000
  • Fixed issues causing RevertPrecompiled* test failures
  • Fixed an issue where the RIPEMD precompile has to remain touched even when the call reverts and be considered for deletion, see EIP-716 for context
  • Updated ethereumjs-block to v2.2.1
  • Updated ethereumjs-blockchain to v4.0.2
  • Limited ethereumjs-util from ^6.1.0 to ~6.1.0
  • Hardfork-related fixes in test runners and test utilities

Other Changes

  • Introduction of a new caching mechanism to cache calls towards promisify being present in hot paths (performance optimization), PR #​600
  • Renamed some missing result.return to result.returnValue on EVM execution in examples, PR #​604
  • Improved event documentation, PR #​601

v4.1.0: @​ethereumjs/common v4.1.0

Compare Source

Holesky Testnet Support

This release comes with full support for the Holesky public Ethereum testnet replacing the Goerli test network.

EIP-7516 BLOBBASEFEE Opcode

This release supports EIP-7516 with a new BLOBBASEFEE opcode added to and scheduled for the Dencun HF, see PR #​3035 and #​3068. The opcode returns the value of the blob base-fee of the current block it is executing in.

Dencun devnet-11 Compatibility

This release contains various fixes and spec updates related to the Dencun (Deneb/Cancun) HF and is now compatible with the specs as used in devnet-11 (October 2023).

  • Update EIP-4788: do not use precompile anymore but use the pre-deployed bytecode, PR #​2955
  • Small Cancun-related fixes, PR #​3099
Bugfixes
  • Updates and fixes along Geth genesis file parsing, PR #​2961
  • Handle forkHash on timestamp == genesis timestamp, PR #​2959
Other Changes
  • Performance: Cache Parameter Values + activated EIPs for current Hardfork, PR #​2994

v4.0.2: @​ethereumjs/tx v4.0.2

Compare Source

Maintenance release with dependency updates, PR #​2445


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/ethereumjs-tx-5.x branch from 6d0b801 to 0e03af4 Compare March 19, 2024 05:23
@renovate renovate bot force-pushed the renovate/ethereumjs-tx-5.x branch from 0e03af4 to f5ad5a7 Compare March 19, 2024 05:27
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.

0 participants