Use block number for eth_call in rpc-eth-client (#435)

* Update subgraph readme to run fill before job-runner

* Fix getContractEntitiesMap incase of template data sources

* Use rpcSupportsBlockHashParam flag to use blockNumber for rpc client eth_call

* Fix optional baseFeePerGas in rpc-eth-client

* Fix graph-node tests after changes

* Remove completed TODO
This commit is contained in:
2023-10-25 11:04:12 +05:30
committed by GitHub
parent e8d8476bef
commit 07887c160e
24 changed files with 61 additions and 23 deletions
+1
View File
@@ -221,6 +221,7 @@ export interface ServerConfig {
p2p: P2PConfig;
// TODO: Move flag to config upstream.ethServer
// Flag to specify whether RPC endpoint supports block hash as block tag parameter
// https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block
rpcSupportsBlockHashParam: boolean;
+6 -1
View File
@@ -151,7 +151,12 @@ export const getContractEntitiesMap = (dataSources: any[]): Map<string, string[]
// Populate contractEntitiesMap using data sources from subgraph
dataSources.forEach((dataSource: any) => {
const { source: { address: contractAddress }, mapping: { entities } } = dataSource;
contractEntitiesMap.set(ethers.utils.getAddress(contractAddress), entities as string[]);
// TODO: Handle template data source
// TODO: Avoid mapping subgraph entities to contract address in watcher state
if (contractAddress) {
contractEntitiesMap.set(ethers.utils.getAddress(contractAddress), entities as string[]);
}
});
return contractEntitiesMap;
+1 -1
View File
@@ -550,7 +550,7 @@ export const toEntityValue = async (instanceExports: any, entityInstance: any, d
// Check if the entity property is nullable.
// No need to set the property if the value is null as well.
if (isNullable && value === null) {
return;
return value;
}
const entityValue = await formatEntityValue(instanceExports, subgraphValue, type, value, isArray);
+2 -2
View File
@@ -52,7 +52,7 @@ export interface StateStatus {
export type ResultState = {
block: {
cid: string;
cid: string | null;
hash: string;
number: number;
timestamp: number;
@@ -66,7 +66,7 @@ export type ResultState = {
export type ResultEvent = {
block: {
cid: string;
cid: string | null;
hash: string;
number: number;
timestamp: number;
+1 -1
View File
@@ -20,7 +20,7 @@ export interface StateDataMeta {
},
ethBlock: {
cid: {
'/': string
'/': string | null
},
num: number
}
+1 -1
View File
@@ -19,7 +19,7 @@ export enum StateKind {
export interface BlockProgressInterface {
id: number;
cid: string;
cid: string | null;
blockHash: string;
parentHash: string;
blockNumber: number;