streamingfast / substreams-rs

9 stars 3 forks source link

Operations on StoreMaxInt64 deltas #10

Closed fschoell closed 1 year ago

fschoell commented 1 year ago

A question regarding deltas from StoreMaxInt64. I'd have assumed that Operation::Create would be triggered whenever store.max() was called the first time and then subsequently Operation::Update would be triggered whenever store.max() was called with a value greater than the stored one. For example to translate those deltas into database operations. But it seems Operation::Create does get called more often (got errors from the postgres sink that the PK already exists on insert). Is this a bug with the store deltas or intended behaviour?

See here for how this is used: https://github.com/pinax-network/substreams/blob/63b7afac64546618baef18ecf203e1c32bce9329/substreams/blocktivity/src/lib.rs#L97-L108

colindickson commented 1 year ago

@fschoell can you confirm that this is solved? (related to https://github.com/streamingfast/substreams-sink-postgres/issues/10 )

fschoell commented 1 year ago

Yes it's solved