8000 Releases · wevm/ox · GitHub
[go: up one dir, main page]

Skip to content

Releases

ox@1.9.3

Choose a tag to compare

@github-actions github-actions released this 04 Dec 06:47
38a91b1

Patch Changes

  • #749 734fbef Thanks @tcoratger! - Fixed TxEnvelopeEip4844.deserialize and TxEnvelopeEip7702.deserialize to throw TransactionEnvelope.MissingToError when to is empty, since blob and set-code transactions cannot create a contract.

ox@1.9.2

Choose a tag to compare

@github-actions github-actions released this 04 Dec 06:39
08f0181

Patch Changes

  • #737 92004e3 Thanks @jxom! - Fixed AbiParameters.decode rejecting its own encoding of zero-width array elements or tuple components (such as uint256[0][] or (string[0], uint256[0])) that end at the end of the data.

  • #742 0910d5d Thanks @jxom! - Added a userVerification option to Authentication.verify (default 'required'). metadata.userVerificationRequired no longer decides whether the UV flag is checked.

    Authentication.verify({
      challenge,
      metadata,
      publicKey,
      signature,
    + userVerification: 'preferred', // to accept assertions without user verification
    })
  • #743 323933b Thanks @jxom! - Fixed Execute.decodeData and Execute.decodeBatchOfBatchesData to read opData only when the first head word is at least 0x40, as ERC7821.sol does.

  • #737 92004e3 Thanks @jxom! - Fixed SignatureErc8010.unwrap throwing a native SyntaxError instead of SignatureErc8010.InvalidWrappedSignatureError for a wrapped signature shorter than its length word and magic bytes.

  • #737 92004e3 Thanks @jxom! - RpcTransport.fromHttp rejected a JSON-RPC response whose id did not match the request id (except id: null on an error response) with RpcTransport.ResponseIdMismatchError, instead of resolving with another request's result.

  • #737 92004e3 Thanks @jxom! - TxEnvelope*.deserialize rejected integer fields with a leading zero byte, uint256 fields longer than 32 bytes (uint64 for the EIP-7702 and authorization nonce), integer fields given as RLP lists, and access-list entries that are not [address, storageKeys] pairs, as the execution specs do, instead of decoding them to a transaction whose serialization and hash differ from the input.

  • #741 a7cf2ab Thanks @jxom! - Fixed WebCryptoP256.verify to left-pad r and s shorter than 32 bytes, as P256.verify does.

ox@0.16.0

Choose a tag to compare

@github-actions github-actions released this 04 Dec 09:00
6251756

Minor Changes

  • #750 e862358 Thanks @jxom! - Breaking: Updated EIP-8141 frame transactions and EIP-8250 keyed nonces to the current specifications: TxEnvelopeEip8141 replaces maxFeePerGas and maxFeePerBlobGas with a total maxFee budget (encoded as fees = [maxFee, maxPriorityFeePerGas], and as maxFee in RPC, TransactionRequest, and Transaction), getSignPayload commits to the byte length of canonical-payload signatures instead of eliding them, the expiry verifier moved to 0x81413f0cF12e9b6a49B1D0439E081c577D57FfFf, nonceKeys: [] selects the legacy nonce (zero is an ordinary key), non-empty keys accept a single-use sequence of 2^64 - 1, and intrinsic gas prices keyed nonce access and canonical-payload signature bytes as the specifications do.

     TxEnvelopeEip8141.from({
       chainId,
       frames,
    -  maxFeePerGas: Value.fromGwei('10'),
    +  maxFee: Value.fromEther('0.01'),
       maxPriorityFeePerGas: Value.fromGwei('1'),
    -  nonceKeys: [0n],
    +  nonceKeys: [],
       sender,
     })

ox@0.15.3

Choose a tag to compare

@github-actions github-actions released this 04 Dec 06:46
82df944

Patch Changes

  • #751 ba8fb55 Thanks @jxom! - Fixed TxEnvelopeEip4844.deserialize and TxEnvelopeEip7702.deserialize to throw TransactionEnvelope.MissingToError when to is empty, since blob and set-code transactions cannot create a contract.

ox@0.15.2

Choose a tag to compare

@github-actions github-actions released this 04 Dec 05:47
d28adea

Patch Changes

  • #744 56b2ccf Thanks @jxom! - Added a userVerification option to Authentication.verify (default 'required'). metadata.userVerificationRequired no longer decides whether the UV flag is checked.

    Authentication.verify({
      challenge,
      metadata,
      publicKey,
      signature,
    + userVerification: 'preferred', // to accept assertions without user verification
    })
  • #745 eaca8a7 Thanks @jxom! - 8000 Fixed Execute.decodeData to read opData only when the first head word is at least 0x40, as ERC7821.sol does.

ox@1.9.1

Choose a tag to compare

@github-actions github-actions released this 28 Nov 01:04
ae4085a

Patch Changes

  • #729 97fa384 Thanks @jxom! - Fixed AbiParameters.decode to throw AbiParameters.DataSizeTooSmallError when a static parameter head after a dynamic parameter is missing, instead of reading an earlier word as its value.

  • #729 97fa384 Thanks @jxom! - Added blockAccessListHash (EIP-7928) and slotNumber (EIP-7843) to Block.Block, Block.fromRpc, Block.toRpc, and the zod Block schemas.

  • #729 97fa384 Thanks @jxom! - Added baseFeePerBlobGas and blobGasUsedRatio to Fee.FeeHistory, Fee.fromHistoryRpc, Fee.toHistoryRpc, and the zod FeeHistory schema.

  • #729 97fa384 Thanks @jxom! - Fixed PersonalMessage.encode to throw Hex.InvalidLengthError for odd-length hex instead of returning a misaligned message.

  • #729 97fa384 Thanks @jxom! - Fixed Hex.toString, Bytes.toString, and AbiParameters.decode to keep a leading U+FEFF in decoded strings instead of dropping it as a byte order mark.

ox@0.15.1

Choose a tag to compare

@github-actions github-actions released this 28 Nov 00:58
8a80ad3

Patch Changes

  • #730 d542947 Thanks @jxom! - Fixed AbiParameters.decode to throw when a static parameter head after a dynamic parameter is missing, instead of reading an earlier word as its value.

  • #730 d542947 Thanks @jxom! - Added blockAccessListHash (EIP-7928) and slotNumber (EIP-7843) to Block.Block, Block.fromRpc, and Block.toRpc.

  • #730 d542947 Thanks @jxom! - Added baseFeePerBlobGas and blobGasUsedRatio to Fee.FeeHistory.

  • #730 d542947 Thanks @jxom! - Fixed PersonalMessage.encode to throw Hex.InvalidLengthError for odd-length hex instead of returning a misaligned message.

  • #730 d542947 Thanks @jxom! - Fixed Hex.toString, Bytes.toString, and AbiParameters.decode to keep a leading U+FEFF in decoded strings instead of dropping it as a byte order mark.

ox@1.9.0

Choose a tag to compare

@github-actions github-actions released this 25 Nov 19:25
256f1a6

Minor Changes

  • #727 13ae075 Thanks @jxom! - Improved AbiEvent.extractLogs type-checking performance: with several event names the event type is selected by name without computing the overload arguments of every event, and without an event name it is the ABI's events, which also types an overloaded event's arguments as the union of its overloads instead of unknown (5 to 10× fewer instantiations per call).

  • #727 13ae075 Thanks @jxom! - Fixed Rlp.from, Rlp.fromHex and Rlp.fromBytes accepting malformed hex leaves: a leaf with a non-hex digit, without a lowercase 0x prefix (including 0X…, which Hex.validate and Bytes.fromHex already rejected), or empty now throws Hex.InvalidHexValueError for every output, as Rlp.encodeTo does, instead of producing invalid hex, encoding a bad single-byte leaf as 0x00, or encoding a prefix-less leaf as empty.

  • #720 e4fc3ef Thanks @jxom! - Made AbiParameters and Cbor tree-shakeable by replacing their runtime namespaces with plain functions, so importing one of their errors or utilities no longer bundles packed encoding or the whole CBOR codec (AbiParameters.encodePacked.encode, an undocumented helper, is no longer exported).

  • #727 13ae075 Thanks @jxom! - Improved type-checking of TypedData.encodeType, hashStruct, hashType, encodeData, encodeField and findTypeDependencies by about 700x (11,700 to 17 instantiations for a call): their types parameter is a plain record of { name, type } lists instead of abitype's TypedData.

Patch Changes

  • #727 13ae075 Thanks @jxom! - Improved AbiParameters.decode performance on data of up to 64 bytes: it copies words instead of viewing them, which V8 would first move to an ArrayBuffer of their own (one uint256 547 → 328 ns, one address 629 → 456 ns).

  • #727 13ae075 Thanks @jxom! - Made AbiParameters.encode and AbiFunction.encodeData build their output as a string of hex digits instead of writing a byte buffer and hex-encoding it, skipped the integer-type regex and bound arithmetic for uint256 and int256, lowercased addresses with the native toLowerCase, and had AbiFunction.encodeData, AbiItem.getSelector, AbiItem.getSignature and AbiItem.getSignatureHash take their arguments without a rest array and closure, so AbiParameters.encode runs about 4x faster, AbiFunction.encodeData about 4x faster with 4x less memory, and AbiItem.getSelector about 7x faster with 12x less memory, with the output and errors unchanged.

  • #720 e4fc3ef Thanks @jxom! - Reduced the type instantiations of ABI encoding calls with inline values, such as AbiParameters.encodePacked (about 120×), AbiFunction.encodeResult (about 50×), and AbiParameters.encode, AbiFunction.encodeData, AbiError.encode, AbiConstructor.encode and AbiEvent.encode (about 5×).

  • #720 e4fc3ef Thanks @jxom! - Declared AbiError.solidityError and AbiError.solidityPanic as literals, so decoding or encoding an error no longer bundles the human-readable ABI parser.

  • #727 13ae075 Thanks @jxom! - Reduced the type instantiations of AbiItem.fromAbi, AbiFunction.fromAbi, AbiEvent.fromAbi and AbiError.fromAbi (about 2.2×): fromAbi.Options declares prepare in each of its branches instead of intersecting it with them.

  • #727 13ae075 Thanks @jxom! - Reduced the type instantiations of AbiFunction.encodeData calls: a function without inputs is recognized without resolving its parameter types (72 → 43 for a call without arguments).

  • #727 13ae075 Thanks @jxom! - Made AbiItem.fromAbi (and the fromAbi of AbiFunction, AbiEvent, AbiError) find a uniquely named item without collecting matches into an array, which cuts the memory a lookup allocates by about 4x.

  • #727 13ae075 Thanks @jxom! - Removed the top-level side effects of Errors.BaseError (its static initialization block), so bundles no longer keep BaseError and a module's unused error classes whenever they import anything from that module. Errors.BaseError.defaultStaticOptions is now a getter.

  • #727 13ae075 Thanks @jxom! - Made Bytes.fromNumber write non-negative values up to 2^53, and negative signed values of up to 6 bytes, without BigInt arithmetic (about 3-4x faster for non-negative values and 3x faster for negative ones), and larger values 32 bits per BigInt operation (about 3.5x faster for 200-bit values); the output and errors are unchanged.

  • #720 e4fc3ef Thanks @jxom! - Fixed Bytes.fromNumber taking quadratic time for values or sizes above 64 bytes.

  • #720 e4fc3ef Thanks @jxom! - Fixed Cbor.decode throwing a RangeError for a truncated 32-bit or 64-bit float instead of Cursor.PositionOutOfBoundsError.

  • #727 13ae075 Thanks @jxom! - Reduced the type instantiations of Signature and Signature.toRpc's input, of the as-dependent return types (Hash, Secp256k1, P256, Ed25519, Bls, Rlp and others), and of Rlp.fromHex and Rlp.fromBytes options, without changing the resolved types.

  • #727 13ae075 Thanks @jxom! - Gave dist its own package.json (type and sideEffects only), so Node no longer parses ox's whole exports map for every module it loads, which makes importing ox in Node about twice as fast (ox 260 → 125 ms, ox/Hex 11 → 6.5 ms).

  • #727 13ae075 Thanks @jxom! - Made Ens.normalize return names already in ENSIP-15 normal form (lowercase ASCII labels) without running the normalizer, which is about 60x faster for them; other names are normalized as before.

  • #727 13ae075 Thanks @jxom! - Wrote the ABI parameters behind SignatureErc6492.wrap/unwrap, Execute batch-of-batches encoding and decoding, and Calls.encode/decode/getAbiParameters out as JSON, so using them no longer bundles the human-readable ABI parser.

  • #727 13ae075 Thanks @jxom! - Improved SignatureErc6492.validate performance: it checks the magic suffix directly instead of catching the error assert throws, so an invalid signature returns false about 100× faster and the function no longer bundles the error classes.

  • #720 e4fc3ef Thanks @jxom! - Fixed Execute in ox/erc7821 importing the root ox barrel, which made importing ox/erc7821 load every ox module.

  • #727 13ae075 Thanks @jxom! - Wrote SignatureErc8010.suffixParameters out as JSON ABI parameters instead of parsing a human-readable signature at import, so importing anything from ox/erc8010 no longer runs or bundles the ABI parser.

  • #727 13ae075 Thanks @jxom! - Improved Hex.padLeft, Hex.padRight and sized hex encoding (Hex.fromBytes, Hex.fromString, Hex.fromNumber with size) performance: padding up to 32 bytes slices a li...

Read more

ox@0.15.0

Choose a tag to compare

@github-actions github-actions released this 25 Nov 19:16
10e4f6d

Minor Changes

  • #726 e238adb Thanks @jxom! - Bytes.fromHex (and so Rlp.fromHex, Rlp.toHex and every function that reads hex through it) now throws for a value that does not start with 0x, including an uppercase 0X prefix, as ox 1.x does, instead of reading its first two characters as the prefix. For example, Rlp.fromHex('abcd') returned 0x81cd, and Rlp.fromHex('0XAB') returned 0x81ab.

  • #722 538df0d Thanks @jxom! - Breaking: Removed AbiParameters.encodePacked.encode, a runtime namespace member that kept encodePacked (with Address.assert and keccak) in every bundle importing AbiParameters. AbiParameters.format, for example, drops from 5.9 kB to about 1.3 kB gzipped.

    - AbiParameters.encodePacked.encode('uint8', 1)
    + AbiParameters.encodePacked(['uint8'], [1])
  • #722 538df0d Thanks @jxom! - Improved type-checking of AbiParameters.encodePacked by about 8x (106,000 to 13,000 instantiations for a call) by constraining types to readonly unknown[] instead of a union that includes PackedAbiType[]. Values are still typed from the types, but types no longer autocompletes.

  • #722 538df0d Thanks @jxom! - Fixed Hex.toBigInt, Hex.toNumber, Bytes.toBigInt and Bytes.toNumber throwing a SyntaxError (or a NaN range error) for empty input; empty hex and bytes now read as zero.

  • #722 538df0d Thanks @jxom! - Improved type-checking of TypedData.encodeType, hashStruct, hashType, encodeData, encodeField and findTypeDependencies by about 700x (11,700 to 17 instantiations for a call): their types parameter is a plain record of { name, type } lists instead of abitype's TypedData.

  • #722 538df0d Thanks @jxom! - Breaking (ox/erc4337): UserOperation.toRpc dropped an EntryPoint 0.8 authorization; it now writes it as eip7702Auth, the field bundlers read (ERC-7769), and UserOperation.fromRpc reads it back. UserOperation.RpcV08 has eip7702Auth in place of authorization.

     const rpc: UserOperation.RpcV08 = {
       // ...
    -  authorization: { address, chainId: '0x1', nonce: '0x0', r, s, yParity: '0x0' },
    +  eip7702Auth: { address, chainId: '0x1', nonce: '0x0', r, s, yParity: '0x0' },
     }
  • #722 538df0d Thanks @jxom! - Breaking: Value.from (and fromEther, fromGwei) now throws Value.InvalidDecimalNumberError for input without digits ("", ".", "-", "-."), which returned 0n or threw a SyntaxError before, and Value.InvalidDecimalsError for negative or non-integer decimals. A negative value without integer digits, such as "-.0", now parses instead of throwing a SyntaxError.

Patch Changes

  • #726 e238adb Thanks @jxom! - Made AbiParameters.decode (and the ABI decoders built on it) faster for short data: the decoder copies words out of data of up to 64 bytes instead of taking views of it, which made V8 move the data to an ArrayBuffer first, and Bytes.toBigInt reads a fresh word without one. AbiParameters.decode of one word runs about 1.6x faster; the output and errors are unchanged.

  • #726 e238adb Thanks @jxom! - Made AbiFunction.encodeData faster and leaner: it writes the parameters' encoding straight after the selector instead of slicing and copying a 0x-prefixed encoding, AbiItem.getSelector and AbiItem.getSignatureHash no longer allocate a closure and an arguments array per call, and the ABI encoder sizes its list of parameters up front. encodeData of an (address, uint256) call goes from about 300 to 170 ns and from 1.1 kB to 360 B allocated.

  • #726 e238adb Thanks @jxom! - Made AbiParameters.encode build its output as one string of hex digits, instead of creating, slicing and concatenating a 0x string per word. AbiParameters.encode runs about 4x faster with a quarter of the memory, and AbiFunction.encodeData about 3x faster; the output and errors are unchanged.

  • #722 538df0d Thanks @jxom! - Wrote AbiError.solidityError and AbiError.solidityPanic out as literals with the signature hashes AbiError.from adds, instead of calling AbiError.from at module load, so using either no longer bundles the ABI parser and keccak (9.7 kB to 155 B gzipped).

  • #726 e238adb Thanks @jxom! - Made AbiItem.fromAbi (and AbiFunction.fromAbi, AbiError.fromAbi, AbiEvent.fromAbi) find a unique match without collecting the matches into an array first.

  • #726 e238adb Thanks @jxom! - Reduced the type instantiations of the ABI modules' generic signatures. Wide parameters (readonly AbiParameter[]) now resolve to readonly unknown[] without mapping every ABI type, and AbiItem.fromAbi.Options puts prepare in each of its branches instead of intersecting it with them. Parameters<typeof AbiFunction.encodeData> drops from about 10,800 instantiations to 500, AbiParameters.encode from 10,600 to 300, and AbiFunction.fromAbi and AbiItem.fromAbi from about 14,600 to 2,100. The types are unchanged.

  • #726 e238adb Thanks @jxom! - Made Address.checksum build the checksummed address from character codes instead of splitting, uppercasing and joining an array of characters.

  • #722 538df0d Thanks @jxom! - Made Address.isEqual check its inputs without bundling Address.checksum and keccak, which makes its bundle about 4x smaller.

  • #726 e238adb Thanks @jxom! - Made Errors.BaseError set its fields in its constructor instead of declaring them as class fields, which the ES2021 build compiled to an Object.defineProperty call each. Bundles that include an error shrink by about 30 bytes (gzip); errors keep the same properties in the same order.

  • #722 538df0d Thanks @jxom! - Removed the top-level side effects of Errors.BaseError (its static initialization block), so bundles no longer keep BaseError and a module's unused error classes whenever they import anything from that module. Errors.BaseError.defaultStaticOptions is now a getter.

  • #722 538df0d Thanks @jxom! - Fixed Base58 encoding of empty input and all-zero bytes, and Base58.toHex returning odd-length hex for values whose first byte is below 0x10.

  • #726 e238adb Thanks @jxom! - Made Base64.fromBytes encode with Uint8Array.prototype.toBase64 where the runtime has it (about 5x faster on Node 26), and Base64.toBytes decode without TextEncoder and a regular expression (about 6x faster). Valid input decodes as before. A character outside the Base64 alphabets now decodes as zero bits wherever it appears; before, one at the end of a group of four zeroed the group's three bytes, and a non-ASCII character counted once per UTF-8 byte.

  • #726 e238adb Thanks @jxom! - Made Bytes.fromNumber write its bytes directly instead of encoding the number as hex with Hex.fromNumber and decoding that: an unsigned safe integer that fits its size is written without BigInt arithmetic (about 2.5x faster with half the memory), and bundles that only encode numbers to bytes are about 30% smaller. A fractional size now throws for numbers as it already did for bigints. `He...

Read more

ox@1.8.21

Choose a ta 8160 g to compare

@github-actions github-actions released this 23 Nov 19:55
6c82160

Patch Changes

  • #716 dca97e0 Thanks @brendanjryan! - Fixed Secp256k1.verify to reject signatures with a high s value when verifying against an address, matching the publicKey path and fixing SignatureEnvelope.verify in ox/tempo.
0