consider bundling handler writes per block into single DB tx #202
Unanswered
holic
asked this question in
Idea / Feature Request
Replies: 1 comment
-
Interesting idea. When you say your data includes a "last updated block", does that mean you have a single entity record that is getting updated by multiple event handlers within the same block? (That's a scenario where I can see why you would want the transactional guarantee). A workaround might be to add metadata to the GraphQL schema, similar to what the graph does. We could do something like: type Query {
_metadata: Metadata!
}
type Metadata {
latestEventTimestamp: Int!
networks: [NetworkMetadata!]!
}
type NetworkMetadata {
name: String! # mainnet, optimism
chainId: Int! # 1
latestEventBlockNumber: BigInt! # this is what you could use as a "last updated block"
} Then, you could use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am thinking about cases in which I query my ponder service for data (which includes a "last updated block") where I might end up with partial data for that block and unintentionally miss completed data for that block.
This could be solved by bundling all DB writes for a given block into a single DB tx.
The downside is that you may not be able to get the written handler data from another handler or previous event within the same block.
Beta Was this translation helpful? Give feedback.
All reactions