graphprotocol / graphprotocol/graph-node
contract call do not allow you to specify blocknumber and they execute from the block that trigger the handler
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3.2k
- Forks
- 1.1k
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 1
Description
Currently when in my handler I make a call to a contract, it is executed as the block that triggered the handler
This means that such call can potentially act on data in the future (relative to the trigger) since the tx that triggered the handler could be prior to other transactions in the same block that could modify the data that affect the contract call.
It would be great if we could specify which blockNunber to use for contracts. For example reading from currentBlock -1 would make sure the contract call will not only be affected by the action of further tx. It would have the effect of not considering prior tx effect (in the same block) but depending on use case, it can be preferable.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing contract calls made from a handler and how the triggering block is supplied as execution context. Determine how a caller could select an earlier block, such as currentBlock - 1, and define the behavior for calls involving transactions in the same block; done means contract reads honor the selected block without changing the default behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend, blockchain
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100