Layr-Labs / eigenda-proxy

EigenDA sidecar proxy server used for communication between rollup software and EigenDA.
MIT License
14 stars 20 forks source link

feat: Avoid writing twice to the same storage backend #157

Open mcortesi opened 4 days ago

mcortesi commented 4 days ago

handleRedundantWrites will do a write for each source in caches and fallbacks.

While probably doesn't make much sense to have the same type of store be cache and fallback they can technically be the same.

So maybe check that caches ++ fallbacks is an unique set.

Alternative, on configuration processing check that a source can't be at same time cache and fallback

samlaf commented 4 days ago

So we treat sources and fallbacks the same when writing? So I guess they are only differentiated by their read sequence logic? This looks fine to me, though I do have a strong preference for the config approach (KISS).

Alternative, on configuration processing check that a source can't be at same time cache and fallback

I'll let @epociask review this though given he wrote this feature.

epociask commented 3 days ago

Hi @mcortesi - there's already a config invariant to ensure that this case can never be true: https://github.com/Layr-Labs/eigenda-proxy/blob/main/server/config.go#L115-L120

mcortesi commented 1 day ago

@epociask amazin, haven't seen that.. maybe a comment on the code will help for the unaware reader