249 Commits
Author SHA1 Message Date
nabarunandShreerang Kale 18ca4e1a08 Handle user defined types and unnamed function arguments when parsing contract in codegen (#545)
* Handle user defined types in visitor methods when continuing on error

* Handle unnamed arguments in solidity methods

* Update graph-cli package version

---------

Co-authored-by: Shreerang Kale <shreerangkale@gmail.com>
2025-08-13 12:41:16 +05:30
nabarun b572eb9032 Update Lotus EVM null block error message (#543)
* Update null block error message

* Update package versions
2025-03-19 20:13:05 +05:30
nabarun e0e2efd571 Set block totalDifficulty to zero if not available in JSON-RPC response (#540)
* Set total difficulty to zero if not available

* Upgrade package version
2025-03-10 19:27:25 +05:30
prathamesh0 944db0eaf7 Decrement package version (#539) 2024-10-14 12:25:49 +05:30
prathamesh0 ac74da6ea6 Add a CLI to backfill watcher event data (#538)
* Add a CLI to backfill watcher event data

* Add required codegen template

* Increment package version
2024-10-14 12:07:56 +05:30
nabarunandprathamesh 5d7b7fe5b4 Handle template create in subgraph watcher during reorgs (#533)
* Handle template create events processing order during reorgs

* Add removeWatcher method in graph-node dummy indexer for test

* Apply GQL and RPC server middlewares ordered on requested paths

* Increment package version

* Remove console logs

---------

Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-10-11 14:50:52 +05:30
prathamesh0 d413d724c7 Add ETH RPC API to get logs (#536)
* Add eth_getLogs API handler

* Transform events into logs

* Update codegen templates

* Allow GET requests

* Increment package verisons

* Remove unnecessary todo

* Add limit on getLogs results size

* Fix config template
2024-09-16 19:05:45 +05:30
prathamesh0 b46d8816b5 Add ETH RPC API to watcher server (#535)
* Add ETH RPC API to watcher server

* Add eth_call API handler

* Add error handling to eth_call handler

* Parse block tag in eth_call handler

* Add a flag to enable ETH RPC server

* Fix lint errors

* Update block tag parsing
2024-09-13 12:44:00 +05:30
prathamesh0 05fdf85af8 Handle where clause on nested GQL query selections (#531)
* Handle where clause on nested GQL query selections

* Handle variables for arguments on nested selections

* Handle args on nested GQL query selections for plural queries

* Update package versions
2024-08-02 13:42:47 +05:30
prathamesh0 d53fbcf731 Add support for args on nested GQL query selections in subgraph watchers (#530)
* Add support for arguments on nested GQL query selections

* Update package versions
2024-08-01 19:01:54 +05:30
nabarun 37885c64eb Watch contract for multiple data sources from subgraph config (#529)
* Watch contract for multiple data sources from subgraph config

* Upgrade package versions
2024-07-19 17:58:20 +05:30
nabarun 42cb688921 Export metric for total ETH RPC count (#528)
* Export metric for total ETH RPC count by methods

* Fix endpoint switch on max retries of new block

* Upgrade package versions
2024-07-12 16:59:23 +05:30
nabarun 2217cd3ffb Support events handlers in multiple data sources for a contract address (#526)
* Support processing events in multiple subgraph datasources for a single contract address

* Fix parsing event topic in graph-node watcher

* Update codegen templates

* Fix dummy indexer method in graph-node test

* Upgrade package versions to 0.2.102
2024-06-26 17:56:37 +05:30
nabarunandprathamesh b9a899aec1 Implement switching endpoints after slow eth_getLogs RPC requests (#525)
* Switch upstream endpoint if getLogs requests are too slow

* Refactor methods for switching client to indexer

* Update codegen indexer template

* Add dummy methods in graph-node test Indexer

* Upgrade package versions to 0.2.101

---------

Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-06-20 17:57:01 +05:30
nabarun ff471da287 If subgraph block handlers exist force realtime processing in watcher (#524)
* Avoid historical sync for block handlers and eth_getLogs without event handlers

* Stop processing after endBlock in watcher fill CLI

* Codegen changes for avoiding eth_getLogs when no subgraph event handlers exist

* Upgrade package version to 0.2.100

* Check for blockHandlerExists first before block processing

* Fix comments for historical block processing checks
2024-06-20 10:05:53 +05:30
nabarun 981f70ec9b Replace null values when converting bytes to string in graph-node host API (#523)
* Replace null value in strings for postgres text data type

* Upgrade package versions to 0.2.99
2024-06-14 13:47:54 +05:30
nabarun 467c173a0d Use blockHash filter in eth_getLogs query for FEVM (#521)
* Fetch logs by blockHash at head for FEVM

* Upgrade watcher package versions to 0.2.98
2024-06-11 19:07:55 +05:30
prathamesh0 acf69dd554 Add a config option for block processing offset (#520)
* Add config option for block processing offset

* Upgrade package versions
2024-06-10 15:09:33 +05:30
nabarun 52082fc874 Process block with MAX_REORG_DEPTH delay from head (#519)
* Process block behind latest head by reorg height

* Upgrade package versions
2024-06-07 21:12:03 +05:30
nabarun 4d81c14597 Fix order of events processing for FEVM (#518)
* Fix events processing order for FEVM

* Upgrade watcher package version

* Fix getResultEvent for eventsInRange GQL query

* Fix eventFields parsing
2024-06-07 17:23:55 +05:30
nabarunandprathamesh 8d052add2d Log GQL requests in watcher (#517)
* Update config for server GQL

* Add winston logger for GQL requests

* Fix codegen templates for resolver and package

* Update package versions

---------

Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-06-06 16:54:49 +05:30
nabarun 7cc61579d8 Use ethers.js replace util for errors in bytesToString host API (#515)
* Use replacement strategy for ethers.utils.toUtf8String in graph-node host API

* Upgrade package versions
2024-06-04 11:41:54 +05:30
nabarun 3b67fa1827 Use module read-pkg for reading package.json (#513)
* Use module read-pkg for reading package.json

* Upgrade package versions
2024-05-30 15:42:57 +05:30
nabarun f00f6d2998 Update chain head exporter CLI to support running multiple instances (#512)
* Update chain-head-exported CLI for running multiple instances

* Update upstream RPC for metrics with active endpoint

* Export metrics for watcher package version and commitHash

* Upgrade package versions
2024-05-30 14:37:35 +05:30
nabarun 4fd6bf4ad7 [WIP] Handle GQL query fragment for single entity query (#511)
* Handle GQL query fragment for single entity query

* Upgrade package versions
2024-05-17 18:47:15 +05:30
nabarunandprathamesh b57aa76d9f Support fragments in GQL queries for subgraph watchers (#510)
* Avoid updating latest block metrics on RPC errors

* Handle fragments in subgraph GQL queries

* Upgrade package versions

* Move private method in util graph database

---------

Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-05-17 17:20:29 +05:30
nabarun 20fa6ceaa6 Remove check for isFEVM flag when filtering event logs by topics (#508)
* Remove check for FEVM flag when filtering logs by topics

* Update package versions
2024-05-16 11:24:41 +05:30
prathamesh0 c7e6baa263 Add metrics to monitor errors and duration for ETH RPC requests (#507)
* Add metrics to monitor errors and duration for ETH RPC requests

* Check for server error

* Add a metric with configured upstream ETH RPC endpoints

* Use Gauge for RPC requests duration metric

* Filter out unknown events while loading event count on start

* Update package versions

* Rethrow errors in overridden send provider method
2024-05-15 19:11:22 +05:30
nabarun c9696c3d9f Implement failover for RPC endpoints in watcher (#506)
* Handle RPC endpoint server errors and switch failover endpoints

* Add config maxNewBlockRetries for switching to failover endpoint

* Upgrade package versions

* Move unknown events removal after event processing for historical sync

* Rename doFailOverEndpoints to switchClients
2024-05-09 16:03:06 +05:30
nabarun 6d837dc824 Fix address filter param in eth_getLogs request (#505)
* Fix eth_getLogs address filter param

* Upgrade package versions
2024-05-03 14:24:05 +05:30
nabarun edaec5a028 Fetch logs filtered by block number instead of block hash for FEVM (#504)
* Fetch logs by block number for FEVM and use node-fetch for eth_getLogs

* Upgrade package versions
2024-05-02 16:04:31 +05:30
prathamesh0 67425690e9 [WIP] Skip contract events if no match found in ABI (#503)
* Skip contract events if no match found in ABI

* Update package versions
2024-03-19 17:52:00 +05:30
prathamesh0 59edc178c9 Fix for generating nested filters and loading subgraph entities from db (#502)
* Handle ThunkComposer field types when generating nested filters

* Fix type setting for relational fields when loading a subgraph entity from db

* Fix loading nullable relational fields in GQL queries

* Update package versions
2024-03-14 11:21:52 +05:30
prathamesh0andnabarun ff44fd8717 Fix event processing and entities query for filecoin watchers (#501)
* Filter out pruned subgraph entities while fetching from db

* Sort events by tx index first incase upstream is FEVM

* Upgrade package versions

---------

Co-authored-by: Nabarun <nabarun@deepstacksoft.com>
2024-03-06 11:10:41 +05:30
nabarun 1cf1a3baa2 Upgrade package versions to 0.2.80 (#500) 2023-12-28 15:17:06 +05:30
nabarun 33e4455f92 Fix pruning of canonical block if null block is encountered (#499) 2023-12-28 15:07:12 +05:30
nabarun a6deed9c27 Fix block processing during chain reorg (#498)
* Fix block processing during chain reorg

* Add new method in test dummy indexer

* Add missing semicolon
2023-12-28 15:06:47 +05:30
prathamesh0 78e43bc088 Export metrics for watcher config and upstream and external chain heads (#497)
* Add a cli to export chain head block numbers

* Use ETH RPC endpoint and allow env overrides

* Use ethers provider

* Export upstream chain head block number in watcher metrics

* Remove unnecessary exports

* Upgrade package versions

* Fix defaults usage

* Export watcher config in metrics

* Add metric for watcher sync mode

* Remove cache flag from watcher config metrics

* Update watcher config field names
2023-12-19 15:23:25 +05:30
prathamesh0 37732d1b1e Upgrade package versions (#496) 2023-12-05 18:27:09 +05:30
nabarun 220f3ddf24 Fix events processing error check in historical processing (#491)
* Fix events queue error check in historical processing

* Upgrade package version
2023-11-26 12:42:43 +05:30
nabarun 3fa3cc7068 Upgrade package versions to 0.2.76 (#490) 2023-11-24 12:04:11 +05:30
6decf61d4c Update subgraph watcher demo readme (#480)
* Update subgraph watcher demo readme

* Pass extra block data required in subgraph block handler (#486)

* Use codegen config directory name instead of file path

* Get block data from extra event data

* Add extra event data in processBlockAfterEvents

---------

Co-authored-by: neeraj <neeraj.rtly@gmail.com>

* Update example subgraph mapping code for graph-cli upgrade

* Return 0 value for block size in ipld-eth-client

---------

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2023-11-24 11:13:40 +05:30
nabarun 937aed139f Fix sync status update in historical processing job (#488)
* Fill watcher start block only in active mode

* Fix sync status update in historical processing

* Upgrade package versions

* Upgrade package versions in codegen template

* Fix graph-node test indexer
2023-11-23 20:25:39 +05:30
prathamesh0 ffd1d267d8 Implement remaining json host APIs (#487)
* Instantiate a new wasm string to convert JSON value to BigInt

* Implement remaining json host APIs

* Upgrade graph-ts and graph-cli in test example subgraph

* Handle null context for dataSource context host API

* Use JSONBig for parsing JSON strings
2023-11-22 18:03:21 +05:30
nabarun 729d862aac Fix fetching blocks near chain head in job-runner (#485)
* Fix null blocks check in job-runner when fetching near chain head

* Upgrade package versions
2023-11-21 17:44:54 +05:30
prathamesh0 e6b957e921 Mark entities as removed on store remove host API call (#484) 2023-11-21 16:00:26 +05:30
prathamesh0 2faf905d99 Implement remaining graph-node host APIs for templates (#475)
* Implement createWithContext graph-node dataSource host API

* Parse individual context entries

* Implement graph-node dataSource context host API

* Handle array type fields and refactor code

* Resolve all values when parsing an array field

* Fix wasm entity creation with array type fields

* Required codegen changes
2023-11-20 15:02:08 +05:30
nabarun c2070a80cb Handle null block error in rpc-eth-client (#477)
* Remove block-size-cache util methods as full block with size fetched already

* Handle null block error in rpc-eth-client

* Upgrade package versions
2023-11-17 11:58:43 +05:30
nabarunandneeraj e54f4c9276 Implement host API for big decimal equals (#476)
* Implement host api for big decimal equals

* Add test cases for big decimal equals

* Use boolean type conversion

---------

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
2023-11-17 10:26:03 +05:30
nabarunandneeraj 7c8f84b1dc Remove prefetchBlocksInMem flag along with functionality (#474)
* Remove prefetchBlocksInMem flag

* Remove Indexer method fetchEventsAndSaveBlocks

* Throw error if pruning not safe

---------

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
2023-11-16 19:03:13 +05:30