You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TransactionFetcher is a complex type. buffered_hashes is a subset of keys in unknown_hashes. keys in eth68_meta is also a subset of unknown_hashes. naturally one would like to aggregate those three into a type. nonetheless, inflight_requests and buffered_hashes are also an invariant, they are disjoint sets.
what would improve the type safety in TransactionFetcher most of all to start with, is making the separation between TxHashes from NewPooledTransactionHashes66 announcements and from NewPooledTransactionHashes68 announcements. this is useful since requests are packed differently for each version.
since we store both hash versions alongside each other in unknown_hashes and buffered_hashes, eventually we would probably wrap them in an enum, so it makes sense to make one versioned wrapper type to start with: NewTxHash that has a method eth_version.
'new' refers to 'unknown' + 'previously unseen upon arrival in an announcement' (check the on_new_pooled_transaction_hashes pipeline, then the latter makes more sense). a hash which makes it past this filter is a NewTxHash.
we could even have intermediary type UnknownTxHash, as output of the first filter, to make it clear that the input to filter_unseen_hashes is the type UnknownTxHash.
conversion from a TxHash to a versioned wrapper needs to be parametrised with the EthVersion. the best way to do this is to modify methods of NewPooledTransactionHashes to return the NewTxHash type that wraps type B256.
NewTxHash could optionally hold a (type, size) metadata tuple. this would mean that we don't need to store the size for eth68 hashes separately in eth68_meta. if we want to do this is debatable. if we do, then the versioned hash wrapper is a bit bigger than a TxHash. if we don't do this every eth68 TxHash in unknown_hashes is stored double up, since we need to store it in eth68_meta.
Additional context
No response
The text was updated successfully, but these errors were encountered:
on second thought, would prefer to store eth68 and eth66 separately, so two separate types NewTxHash68 and NewTxHash66. then we would have buffered_hashes_68 and buffered_hashes_66, and unknown_hashes_68 and unknown_hashes_66.
Describe the feature
TransactionFetcher
is a complex type.buffered_hashes
is a subset of keys inunknown_hashes
. keys ineth68_meta
is also a subset ofunknown_hashes
. naturally one would like to aggregate those three into a type. nonetheless,inflight_requests
andbuffered_hashes
are also an invariant, they are disjoint sets.what would improve the type safety in
TransactionFetcher
most of all to start with, is making the separation betweenTxHash
es fromNewPooledTransactionHashes66
announcements and fromNewPooledTransactionHashes68
announcements. this is useful since requests are packed differently for each version.since we store both hash versions alongside each other in
unknown_hashes
andbuffered_hashes
, eventually we would probably wrap them in an enum, so it makes sense to make one versioned wrapper type to start with:NewTxHash
that has a methodeth_version
.'new' refers to 'unknown' + 'previously unseen upon arrival in an announcement' (check the on_new_pooled_transaction_hashes pipeline, then the latter makes more sense). a hash which makes it past this filter is a
NewTxHash
.we could even have intermediary type
UnknownTxHash
, as output of the first filter, to make it clear that the input tofilter_unseen_hashes
is the typeUnknownTxHash
.conversion from a
TxHash
to a versioned wrapper needs to be parametrised with theEthVersion
. the best way to do this is to modify methods ofNewPooledTransactionHashes
to return theNewTxHash
type that wraps typeB256
.NewTxHash
could optionally hold a(type, size)
metadata tuple. this would mean that we don't need to store the size for eth68 hashes separately ineth68_meta
. if we want to do this is debatable. if we do, then the versioned hash wrapper is a bit bigger than aTxHash
. if we don't do this every eth68TxHash
inunknown_hashes
is stored double up, since we need to store it ineth68_meta
.Additional context
No response
The text was updated successfully, but these errors were encountered: