Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQL getBlockDetails: add receipts LRU #12852

Open
AskAlexSharov opened this issue Nov 23, 2024 · 3 comments
Open

GraphQL getBlockDetails: add receipts LRU #12852

AskAlexSharov opened this issue Nov 23, 2024 · 3 comments
Assignees
Labels
erigon3 imp1 High importance
Milestone

Comments

@AskAlexSharov
Copy link
Collaborator

Maybe same blocks and receipts LRU as was in RPC (or different if it’s hard).

Probably it does re-exec because Receipt requested:

cpu

@AskAlexSharov AskAlexSharov added imp1 High importance erigon3 labels Nov 23, 2024
@AskAlexSharov AskAlexSharov added this to the 3.0.0-beta1 milestone Nov 23, 2024
@SLoeuillet
Copy link
Contributor

SLoeuillet commented Nov 23, 2024

Here is the GraphQL request responsible for this profile :

	jsonData := map[string]string{
		"query": fmt.Sprintf(`
			{	
				block(number: %d ) {
					number
					difficulty
					extraData
					gasLimit
					gasUsed
					logsBloom
					ommerHash
					ommers{
					  hash
					}
					miner {
					  address
					}
					mixHash
					nonce
					hash
					parent {
					  hash
					}
					receiptsRoot
					stateRoot
					timestamp
					transactionsRoot
					transactions {
					  createdContract {
						address
					  }
					  cumulativeGasUsed
					  from {
						address
					  }
					  gasUsed
					  gasPrice
					  inputData
					  nonce
					  index
					  value
					  logs {
						account {
						  address
						}
						data
						index
						topics
					  }
					  hash
					  index
					  to {
						address
					  }
					  status
					}
				  }
				}
        `, blockNumber),
	}

@SLoeuillet
Copy link
Contributor

SLoeuillet commented Nov 23, 2024

Everytime we launch a backfill (from first block or more generaly from first block of a pool or ERC20 token, we run that query for each block)

Rest of the time, we run this query on each block while they arrive on chain tip

@SLoeuillet
Copy link
Contributor

@scorring @Ugo got that trace by using the following command

/opt/golang/bin/go tool pprof -png "http://127.0.0.1:6062/debug/pprof/profile?debug=1&seconds=20" > cpu.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
erigon3 imp1 High importance
Projects
None yet
Development

No branches or pull requests

3 participants