Within our tx package we have a TransactionCache object:
export interface TransactionCache {
hash?: Uint8Array
dataFee?: {
value: bigint
hardfork: string | Hardfork
}
senderPubKey?: Uint8Array
// TODO: re-add these cache items for the JSON
//accessListJSON?: AccessList
//authorityListJSON?: AuthorizationList
}
This is there, but it does not seem tested that well:

In particular, this should likely be the behavior: we should only cache if the tx object itself is frozen (as in Object.frozen. If it is not frozen, the values could change, and therefore the cache should be invalidated.
The accessListJSON and authorityListJSON should also be added in to cache these items when toJSON is called on the tx (or: we could also cache the resulting JSON object. If the tx object is frozen we can also freeze the resulting cached object!)
Within our tx package we have a
TransactionCacheobject:This is there, but it does not seem tested that well:
In particular, this should likely be the behavior: we should only cache if the tx object itself is frozen (as in
Object.frozen. If it is not frozen, the values could change, and therefore the cache should be invalidated.The
accessListJSONandauthorityListJSONshould also be added in to cache these items whentoJSONis called on the tx (or: we could also cache the resulting JSON object. If the tx object is frozen we can also freeze the resulting cached object!)