vyperlang / titanoboa

a vyper interpreter
https://titanoboa.readthedocs.io
Other
252 stars 50 forks source link

/abi/abi_contract.py:126: UserWarning: -32601: Method not found #297

Open PatrickAlphaC opened 2 months ago

PatrickAlphaC commented 2 months ago

When I try to send a transaction with a ZKSyncDeployer using titanoboa-zksync, I get this warning:

/Users/patrick/code/gaboon/.venv/lib/python3.11/site-packages/boa/contracts/abi/abi_contract.py:126: UserWarning: No EIP-1559 transaction available, falling back to legacy
  computation = self.contract.env.execute_code(
/Users/patrick/code/gaboon/.venv/lib/python3.11/site-packages/boa/contracts/abi/abi_contract.py:126: UserWarning: -32601: Method not found
  computation = self.contract.env.execute_code(

It looks like, and I could be wrong, this is coming from this line:

https://github.com/vyperlang/titanoboa/blob/69e866a45b7a4bac9a6010943993bbd30c1354b9/boa/network.py#L246

Which is not implemented at the moment?

https://github.com/vyperlang/titanoboa/blob/69e866a45b7a4bac9a6010943993bbd30c1354b9/boa/rpc.py#L79

In any case, the warning line of: computation = self.contract.env.execute_code( is interesting, because it's not really showing where the error is. I think for ZKSync we can just skip this line perhaps? Not exactly sure if this is a titanoboa or titanoboa-zksync issue.

How to replicate

# 1. Setup Gaboon
git clone https://github.com/vyperlang/gaboon
cd gaboon
rye sync
source .venv/bin/activate

# 2. Create zksync gaboon project
mkdir gab-project
cd gab-project
gab init .

echo '[networks.zksync-local]
url = "http://127.0.0.1:8011"
chain_id = 260
zksync = true' >> gaboon.toml

# 3. Setup ZKSync Local Network
npx zksync-cli dev start # Starts the zksync docker node

# 4. Run this command
gab run deploy --network zksync-local --private-key 0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110 
# don't worry, the above is a known private key of the zksync local node

You'll then see the warning in the output:

Running run command...
tx broadcasted: 0xefa47b4ee305f451a2346f5003a10ebbff7ee13f055833569807f2fea7c89d43
0xefa47b4ee305f451a2346f5003a10ebbff7ee13f055833569807f2fea7c89d43 mined in block 0x1dad66e6c055ef740e3beee998cc1a6816c8e8787597084e5115cefa2c6aeece!
Starting count:  0
/PATH/site-packages/boa/contracts/abi/abi_contract.py:126: UserWarning: No EIP-1559 transaction available, falling back to legacy
  computation = self.contract.env.execute_code(
/PATH/site-packages/boa/contracts/abi/abi_contract.py:126: UserWarning: -32601: Method not found
  computation = self.contract.env.execute_code(
tx broadcasted: 0x9eed9534cc1b1d8910033efc27b65617f2b02c7d8712c48c1c6c847b5f16b678
0x9eed9534cc1b1d8910033efc27b65617f2b02c7d8712c48c1c6c847b5f16b678 mined in block 0xac0d90a6b23958aa9a6a7bc386c6c8519f2a7a9c5c74a0e31f18135381244cce!
Ending count:  1
charles-cooper commented 1 month ago

i am not really sure if this is an issue, it just means that boa tried to send an EIP-1559 style transaction but could not get priority fee data, so it falls back to legacy type 1 txn. maybe best to open an issue in titanoboa-zksync and link back to it here

DanielSchiavini commented 1 month ago

The warn is coming from these lines.

The issue is that there is no flag in boa to omit the warning and the whole function is 65 lines that might need to be copied.

charles-cooper commented 1 month ago

Maybe a flag, either suppress_warning or use_legacy_type_1_txn

charles-cooper commented 1 month ago

Maybe the flag should live on the NetworkEnv object so it can be suppressed globally for a given session