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

[RPC] Pending txs event not working #1134

Open
Damantino opened this issue Sep 7, 2024 · 5 comments
Open

[RPC] Pending txs event not working #1134

Damantino opened this issue Sep 7, 2024 · 5 comments
Assignees

Comments

@Damantino
Copy link

System information

output of git branch

* (HEAD detached at v1.2.15.7)
  zkevm
  • 22.04.1-Ubuntu LTS
  • Tag v1.2.15.7

Config File

datadir: /path/to/my/cdk-erigon/datadir
chain: hermez-mainnet
http: true
private.api.addr: localhost:9091
zkevm.l2-chain-id: 1101
zkevm.l2-sequencer-rpc-url: https://zkevm-rpc.com
zkevm.l2-datastreamer-url: stream.zkevm-rpc.com:6900
zkevm.l1-chain-id: 1
zkevm.l1-rpc-url: http://my-l1-node

zkevm.address-sequencer: "0x148Ee7dAF16574cD020aFa34CC658f8F3fbd2800"
zkevm.address-zkevm: "0x519E42c24163192Dca44CD3fBDCEBF6be9130987"
zkevm.address-admin: "0x242daE44F5d8fb54B198D03a94dA45B5a4413e21"
zkevm.address-rollup: "0x5132A183E9F3CB7C848b0AAC5Ae0c4f0491B7aB2"
zkevm.address-ger-manager: "0x580bda1e7A0CFAe92Fa7F6c20A3794F169CE3CFb"

zkevm.default-gas-price: 1
zkevm.max-gas-price: 0
zkevm.gas-price-factor: 0.0375

zkevm.l1-rollup-id: 1
zkevm.l1-block-range: 20000
zkevm.l1-query-delay: 6000
zkevm.l1-first-block: 16896700
zkevm.rpc-ratelimit: 250
zkevm.datastream-version: 2

externalcl: true
http.api: [eth, debug, net, trace, web3, erigon, zkevm]
http.addr: 0.0.0.0
http.vhosts: any
http.corsdomain: any
ws: true

Erigon Command (with flags/config):

./build/bin/cdk-erigon --config="/mnt/ethereum/cdk-erigon/hermezconfig-mainnet.yaml" --ws

Erigon RPC

./build/bin/rpcdaemon --datadir=/path/to/cdk-erigon/data --txpool.api.addr=localhost:9091 --private.api.addr=localhost:9091 --http.api=eth,erigon,web3,net,debug,trace,txpool,zkevm --ws --ws.compression

Expected behaviour

When I connect to the pending txs event, txs are emitted

> wscat -c http://NODE.URL:PORT/
Connected (press CTRL+C to quit)
> { "id": 1, "jsonrpc": "2.0", "method": "eth_subscribe", "params": ["newPendingTransactions"] }
< {"jsonrpc":"2.0","id":1,"result":"0x5559abef09455d8ad1866b59df71bbf4"}

Actual behaviour

It doesn't emit pending txs

Steps to reproduce the behaviour

  1. Launch node, wait until synchronises
  2. Connect via wscat
  3. Subscribe to the event
@V-Staykov V-Staykov self-assigned this Sep 9, 2024
@V-Staykov
Copy link
Collaborator

I can't seem to be able to reproduce it neither on v1.2.15.7 nor on latest zkevm

Here is what I get on Cardona:

> { "id": 1, "jsonrpc": "2.0", "method": "eth_subscribe", "params": ["newPendingTransactions"] }
< {"jsonrpc":"2.0","id":1,"result":"0xbba81772d7f99d0750f8ad4290a62e62"}

@Damantino
Copy link
Author

Hi @V-Staykov the problem is not that it connects to the event, the problem is that it doesn't emit pending txs! Is that a feature or a bug?

@V-Staykov
Copy link
Collaborator

Sorry, I got a bit confused, but got it now. So this currently works on a sequencer, but the RPC nodes don't hold the txpool, so they are not notified on a new pending transaction and thus the WS subscription is not updated.

maybe @mandrigin can elaborate on when and if it is planned for our txpool to copy the sequencer one.

@Damantino
Copy link
Author

@V-Staykov Thanks for the response and summonning @mandrigin .

Me and my team are building a block explorer for zkevm (https://polygon-zkevm.txain.com/) and would like to have access to show them if possible.

@mandrigin
Copy link
Collaborator

we have plans to re-introduce p2p back to cdk-erigon, then each node will have its own txpool, and then all the pending events will work as expected.

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

No branches or pull requests

3 participants