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 eth_call with "pending" parameter does not seem to work on BSC #778

Closed
billyadelphia opened this issue Feb 21, 2022 · 11 comments
Closed
Assignees
Labels
question Further information is requested

Comments

@billyadelphia
Copy link

billyadelphia commented Feb 21, 2022

I tried to check the state changes on the pending transactions using eth_call RPC with pending as the block parameter, it doesn't seem to work on geth BSC. It works fine on GETH for Ethereum.
Does BSC change anything regarding of this capability ?

@pythonberg1997 pythonberg1997 added the question Further information is requested label Feb 21, 2022
@pythonberg1997
Copy link
Contributor

Hi billyadelphia, could you please provide more detailed information, like your environment config, the command you ran and the error message?

@billyadelphia
Copy link
Author

@loverush it just RPC call, example like this

example with web3 js

web3.eth.call({
    to: "0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe", // contract address
    data: "0xc6888fa10000000000000000000000000000000000000000000000000000000000000003" 
}, "pending")
.then(console.log);
> "0x000000000000000000000000000000000000000000000000000000000000000a"

I'ts not about any error, but with pending as the 2nd parameter, the return value should be state on pending transactions, rather than from latest block.

For example, I send a transaction that changed the a value on the contract. If I use "pending" as the parameter, the return value should be the new value even if that transaction isn't confirmed yet. But on BSC the state changes only if the transaction is confirmed.

@pythonberg1997
Copy link
Contributor

@billyadelphia Yes, to improve the performance, we had made some changes. Now both eth.getBlock('pending') and eth.getBlock('latest') will return the latest block. For more information, you can refer to #358.

@pythonberg1997 pythonberg1997 self-assigned this Feb 22, 2022
@billyadelphia
Copy link
Author

@loverush I want that feature to be able to check state on the pending transactions. It is possible if I change some code to enable that feature for my own build of geth ?

@pythonberg1997
Copy link
Contributor

@billyadelphia You can try to compare geth miner module with BSC miner module and do some modification. PLEASE NOTE, this may lead to other bugs, I'm not sure.

@DawkliCrypto
Copy link

Does enabling the --mine flag fixes the issue ?

@DawkliCrypto
Copy link

@billyadelphia did you manage to make the changes ?

@ofarukcaki
Copy link

Using the --mine flag didn't work and resulted in corrupted node. How can I access the pending block?

@billyadelphia
Copy link
Author

@DawkliCrypto @ofarukcaki , I gave up, modifying the code didn't help me.

@loverush can I request to re-enable this feature ? Some people need this. The feature doesn't have to be enabled by default, only if we specify a flag like --enable-pending-block

@ofarukcaki
Copy link

#358

Did you able to find a solution to this problem yet?

It does not make any sense to make such critical change on the codebase. BSC fork of the geth is full of problems

@aitimate
Copy link

Is there any solution now?

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

No branches or pull requests

5 participants