Giter Site home page Giter Site logo

Comments (8)

0xth0mas avatar 0xth0mas commented on July 20, 2024 3

Ran into the same issue today with deposits. Started out with error "qp" for the gas per pubdata value not being right (eth provider has this set at 50000). After I overrode that I got the "mv" error and it looks like the SDK is setting the base_cost to 0. Got around that by calculating the base cost with get_base_cost and passing it as the operator tip.

            gas_price = web3.eth.gas_price
            operator_tip = eth_provider.get_base_cost(gas_limit=eth_provider.RECOMMENDED_DEPOSIT_L2_GAS_LIMIT, gas_per_pubdata_byte=800,gas_price=gas_price)
            l1_tx_receipt = eth_provider.deposit(token=Token.create_eth(),
                                    amount=web3.to_wei(str(depositAmount), "ether"),
                                    gas_per_pubdata_byte=800,
                                    operator_tip=operator_tip)

image
image

from zksync2-python.

lusharenck avatar lusharenck commented on July 20, 2024 3

Ran into the same issue today with deposits. Started out with error "qp" for the gas per pubdata value not being right (eth provider has this set at 50000). After I overrode that I got the "mv" error and it looks like the SDK is setting the base_cost to 0. Got around that by calculating the base cost with get_base_cost and passing it as the operator tip.

            gas_price = web3.eth.gas_price
            operator_tip = eth_provider.get_base_cost(gas_limit=eth_provider.RECOMMENDED_DEPOSIT_L2_GAS_LIMIT, gas_per_pubdata_byte=800,gas_price=gas_price)
            l1_tx_receipt = eth_provider.deposit(token=Token.create_eth(),
                                    amount=web3.to_wei(str(depositAmount), "ether"),
                                    gas_per_pubdata_byte=800,
                                    operator_tip=operator_tip)

image image

this is the right solution

from zksync2-python.

vyastrebovvareger avatar vyastrebovvareger commented on July 20, 2024 1

I will investigate your issue as soon as possible

from zksync2-python.

vyastrebovvareger avatar vyastrebovvareger commented on July 20, 2024

Please. use this URL "https://rpc.ankr.com/eth_goerli" as the URL_TO_ETH_NETWORK
And please have a try with the following example:
https://github.com/zksync-sdk/zksync2-python/blob/master/examples/01_deposit.py

from zksync2-python.

lusharenck avatar lusharenck commented on July 20, 2024

请。使用此 URL"https://rpc.ankr.com/eth_goerli"作为 URL_TO_ETH_NETWORK 请尝试以下示例: https: //github.com/zksync-sdk/zksync2-python/blob/master/examples/01_deposit.py

I got the same error after replacing the rpc
0x8a5d3c948e182e8921b8c43fba2d9d1523a5d557b443be7257466f90d74125fd
image

from zksync2-python.

vyastrebovvareger avatar vyastrebovvareger commented on July 20, 2024

One thing that come to mi mind that you directly setup l2_gas_limit
and this one

   gas_per_pubdata_byte = None # 800
    gas_limit = None # 118722

I would go step by step. Run test from example. Then if you need to calculate precise l2_gas_limit I investigate it and provide an example

from zksync2-python.

chuwt avatar chuwt commented on July 20, 2024

I think the key of this issue is that the value sent on the deposit doesn't add the fee will be used in L2.

here the l1_value should be replaced with value.

value = base_cost + operator_tip + l2_value
check_base_cost(base_cost, value)
call_data = to_bytes(call_data)
tx_receipt = self.main_contract.request_l2_transaction(contract_l2=contract_address,
l2_value=l2_value,
call_data=call_data,
l2_gas_limit=l2_gas_limit,
l2_gas_per_pubdata_byte_limit=gas_per_pubdata_byte,
factory_deps=factory_deps,
refund_recipient=refund_recipient,
gas_price=gas_price,
gas_limit=gas_limit,
l1_value=l1_value)

Also, I think here the gas_limit should be l2_gas_limit

base_cost = self.get_base_cost(gas_price=gas_price,
gas_per_pubdata_byte=gas_per_pubdata_byte,
gas_limit=gas_limit)

Let me know if I'm wrong😄.

from zksync2-python.

lovehhf avatar lovehhf commented on July 20, 2024

Ran into the same issue today with deposits. Started out with error "qp" for the gas per pubdata value not being right (eth provider has this set at 50000). After I overrode that I got the "mv" error and it looks like the SDK is setting the base_cost to 0. Got around that by calculating the base cost with get_base_cost and passing it as the operator tip.

            gas_price = web3.eth.gas_price
            operator_tip = eth_provider.get_base_cost(gas_limit=eth_provider.RECOMMENDED_DEPOSIT_L2_GAS_LIMIT, gas_per_pubdata_byte=800,gas_price=gas_price)
            l1_tx_receipt = eth_provider.deposit(token=Token.create_eth(),
                                    amount=web3.to_wei(str(depositAmount), "ether"),
                                    gas_per_pubdata_byte=800,
                                    operator_tip=operator_tip)

image image

I encountered the same issue today, this code can help solve it, thank you.

from zksync2-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.