Commit Graph

89 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
prathamesh0
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
1cf1a3baa2
Upgrade package versions to 0.2.80 (#500) 2023-12-28 15:17:06 +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
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
3fa3cc7068
Upgrade package versions to 0.2.76 (#490) 2023-11-24 12:04:11 +05:30
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
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
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
3e898914ba
Add GQL where filter and nested order by params based on entity fields (#472)
* Add where filter equals fields based on entity fields

* Add different where filter operations for entity fields

* Add nested where filter for relation fields and filter params or & and

* Remove filters not required for derived fields

* Add nested order by params in schema

* Throw error on trying to sort by array or derived type fields

* Handle array fields while generating order by and where clauses

* Upgrade package versions

---------

Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2023-11-16 12:38:47 +05:30
6ce8d4746d
Upgrade package versions before release (#469) 2023-11-14 15:01:52 +05:30
7b5fbf3d13
Implement new graph-node host API for BigDecimal exponentiation (#467)
* Implement host API for BigDecimal pow

* Handle FEVM future block error in rpc-eth-client getFullBlocks

* Handle future block error in rpc-eth-client getBlockWithTransactions

* Upgrade package versions
2023-11-13 12:22:23 +05:30
66d613767e
Upgrade version to 0.2.69 (#466) 2023-11-10 19:36:21 +05:30
prathamesh0
be24166ea7
Update package versions (#463) 2023-11-10 14:48:35 +05:30
prathamesh0
a8e59eb6b9
Support filtering by topics when fetching logs in rpc-eth-client (#441)
* Support filtering by topics when fetching logs

* Include event signatures from all contracts in topics list

* Refactor common code

* Update package versions
2023-10-26 17:25:56 +05:30
prathamesh0
72ccaa0381
Upgrade nitro-node dependency (#430)
* Upgrade nitro-node to v0.1.15

* Upgrade packages version to v0.2.66

* Add default value for Nitro node store path

---------

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
2023-10-17 18:39:08 +05:30
prathamesh0
e6767c3aca
Pass vouchers for RPC requests in header (#429)
* Send voucher in request header instead of url params

* Handle review changes

* Update package versions

---------

Co-authored-by: Shreerang Kale <shreerangkale@gmail.com>
2023-10-12 17:42:19 +05:30
2b83f38ab6
Upgrade package version to 0.2.64 (#427)
* Upgrade package version to 0.2.64

* Comment CI workflow to publish docker image

* Update CI workflow names
2023-10-12 11:43:17 +05:30
prathamesh0
caa8da7090
Upgrade nitro-node and add Nitro config option for chain URL (#424)
* Upgrade @cerc-io/nitro-node dependency

* Add a separate config option for chain URL used by Nitro node

* Avoid adding ETH RPC method to request URL as no longer needed

* Update package versions
2023-10-05 11:28:13 +05:30
prathamesh0
ae60bbe1ce
Setup config for paid RPC methods and funding amounts with upstream ETH server (#423)
* Add config option for paid RPC methods

* Change rpcProviderNitroNode to nitro

* Add config option for funding amounts

* Handle review changes

* Refactor config and add a method to setup provider with payments

* Upgrade package versions

---------

Co-authored-by: Shreerang Kale <shreerangkale@gmail.com>
2023-10-04 16:10:54 +05:30
prathamesh0
e203154ac7
Support payments to upstream ETH server for RPC requests (#418)
* Add config option for upstream RPC mutation endpoint

* Use mutation endpoint as chain URL for Nitro node

* Add a method to setup an upstream payment channel

* Add a method to send payments to upstream Nitro node

* Upgrade package versions
2023-09-28 15:24:45 +05:30
prathamesh0
32c78a907c
Add a config option to set gossipub direct peers (#414)
* Add support for setting gossipsub direct peers

* Use string array for direct peers config

* Handle empty nitro and consensus config

* Increase consensus write retry attempts

* Rename config option for watcher party peers file

* Handle directPeers array being passed undefined

* Upgrade package versions

---------

Co-authored-by: Shreerang Kale <shreerangkale@gmail.com>
2023-09-22 13:46:20 +05:30
prathamesh0
48e7785367
Upgrade nitro-node package (#415)
* Upgrade nitro-node package

* Update package versions
2023-09-21 18:32:03 +05:30
77312a2f95
Add yamux stream multiplexer in peer package (#413)
* Add yamux muxer to peer

* Upgrade version to 0.2.58

---------

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
2023-09-15 12:19:51 +05:30
prathamesh0
bd73dae1b1
Implement consensus mechanism using mokka (#412)
* Add Consensus class with placeholders

* Implement Consensus constructor

* Move PubsubType to peer package

* Implement remaining methods in Consensus class

* Use existing consensus stream if it exists

* Setup send and receive pipes on consensus streams

* Refactor P2P and consensus setup in server command

* Add Nitro node initialization in server command

* Return objects from server initializations

* Use dynamic imports for ES modules in util package

* Fix util deps

* Change target to es6 to allow creating a Mokka instance

* Set moduleResolution to node16 in util for dynamic imports

* Upgrade @cerc-io/nitro-node package

* Implement retries while sending consensus messages

* Use bunyan for consensus logs and subscribe to state changes

* Use debug for logging state change events

* Handle empty watcher party file path

* Return object from initP2P

* Upgrade @cerc-io/nitro-node package

* Update package versions
2023-09-14 13:47:31 +05:30
prathamesh0
c80e4d0ab7
Add support for gossipsub (#410)
* Replace floodsub with gossipsub

* Add a pubsub flag to support both floodsub and gossipsub

* Fix deps

* Handle empty string values

* Upgrade @cerc-io/libp2p dependency

* Upgrade package versions
2023-09-05 17:54:52 +05:30
f89eea0d2f
Upgrade package versions (#407) 2023-08-30 15:55:35 +05:30
444901eb87
Upgrade package versions to 0.2.54 (#403)
Co-authored-by: neeraj <neeraj.rtly@gmail.com>
2023-08-16 19:07:30 +05:30
f2bc054c19
Rename nitro-client to nitro-node (#402)
* Rename nitro-client to nitro-node

* Upgrade package versions to 0.2.53

---------

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
2023-08-16 17:57:15 +05:30
b600524c8c
Fix dependencies in cli and eth-client packages (#401)
* Fix dependencies in cli and eth-client packages

* Upgrade package versions
2023-08-10 09:58:50 +05:30
prathamesh0
3b090b3987
Handle null blocks in FEVM (#400)
* Avoid gasPrice while serializing tx in getRawTransaction

* Convert base fee to bigint when fetching block data

* Fix methods to get block data in rpc-eth-client

* Fix error checking in rpc-eth-client

* Continue processig after missing null block in FEVM

* Self review fix

* Upgrade package versions

---------

Co-authored-by: Nabarun <nabarun@deepstacksoft.com>
2023-08-09 17:31:11 +05:30
prathamesh0
198d3e65db
Add payments config and charge according to configured rates (#395)
* Track amount paid on payment channels and charge as per query cost

* Add payments manager config

* Fix received payment checks

* Separate out payment not received and amount insufficient errors

* Serve a query for free if its rate is not configured

* Load open payment channels from the stored state

* Take list of free queries from config

* Take mutation rates from config

* Rename query rates config fields

* Take cache settings and request timeout from config

* Upgrade ts-nitro packages

* Upgrade package versions
2023-07-27 15:52:36 +05:30
prathamesh0
6731a640a2
Use a single payment header in payments plugin (#393)
* Add client address field to payments manager

* Use a single payment header in payments plugin

* Upgrade ts-nitro packages

* Rename method to authenticateVoucherForSender

* Upgrade package versions

---------

Co-authored-by: Nabarun <nabarun@deepstacksoft.com>
2023-07-25 13:34:02 +05:30
10fa9d6b4b
Wait for receiving voucher on GQL query (#392)
* Wait for receiving voucher on GQL query

* Add timeout while authenticating voucher and remove listener channel

* Clear timeout after payment received

* Rename variable to paymentListener

* Upgrade package versions

* Add rpcSupportsBlockHashParam flag in config
2023-07-24 13:36:13 +05:30
prathamesh0
eec1965980
Add a payments plugin to GQL server (#391)
* Add a custom payments plugin in server process

* Fix voucher channel read in voucher subscription

* Use voucher hash and signature for payment authentication

* Use a LRU hash map for storing received vouchers

* Avoid hoisting level types to resolve build errors

* Upgrade ts-nitro packages

* Add payments related logs

* Upgrade package versions

* Always allow latestBlock query

* Upgrade ts-nitro packages
2023-07-20 17:22:48 +05:30
11930c0107
Expose peer instance in server CLI and add nitro config options (#390)
* Expose peer instance in server CLI and add nitro config options

* Update package versions

---------

Co-authored-by: prathamesh0 <prathamesh.musale0@gmail.com>
2023-07-13 15:30:31 +05:30
c6e685fc13
Use local lerna for publishing package in CI (#389)
* Use local lerna for publishing package in CI

* Upgrade package versions

* Add new line at EOF
2023-06-28 12:14:51 +05:30