Giter Club home page Giter Club logo

Comments (9)

mvadari avatar mvadari commented on June 15, 2024 1

Reopening because this is a race condition issue, and thus hard to reproduce. Here is the PR that fixes it in xrpl.js: XRPLF/xrpl.js#1883

from xrpl-py.

JST5000 avatar JST5000 commented on June 15, 2024

Do you happen to have a stack trace of the error or code snippet which can reproduce the problem?

from xrpl-py.

mvadari avatar mvadari commented on June 15, 2024

It doesn't actually call in quick succession - there is a 4-second delay between submitting the transaction and retrieving it for the first time.

from xrpl-py.

JST5000 avatar JST5000 commented on June 15, 2024

Closing as unable to reproduce - if you manage to reproduce happy to reopen! :)

from xrpl-py.

brokeharvard avatar brokeharvard commented on June 15, 2024

Would be great if we could get a fix for this incorporated into xrpl.py. I'm receiving the txnNotFound error for every OfferCreate transaction I submit notwithstanding them actually showing up on the ledger.

from xrpl-py.

hammertoe avatar hammertoe commented on June 15, 2024

I'm getting this same failure too. Code that reproduces it:

from xrpl.clients import JsonRpcClient
from xrpl.wallet.main import Wallet
from xrpl.models.requests import AccountNFTs
from xrpl.models.transactions import Memo, NFTokenCancelOffer, NFTokenMint
from xrpl.transaction import safe_sign_and_autofill_transaction
from xrpl.transaction import send_reliable_submission
from xrpl.utils import drops_to_xrp, hex_to_str, str_to_hex


client = JsonRpcClient("http://xls20-sandbox.rippletest.net:51234")

# rBYSPwS3zvB2wu1nb5rxvU5gSuh5qgYW8V                                                                                                                           
wallet = Wallet("sh69ae5M5k7JhYpMmCoPVAz27456p", 0)

mint_args = {
    "account": "rBYSPwS3zvB2wu1nb5rxvU5gSuh5qgYW8V",
    "flags": 8,
    "uri": "",
    "memos": [Memo.from_dict({"memo_data": str_to_hex("Minted by Dealer")})],
    "transfer_fee": 0,
    "token_taxon": 0,
}

mint = NFTokenMint.from_dict(mint_args)
my_tx_payment_signed = safe_sign_and_autofill_transaction(mint, wallet, client)
tx_response = send_reliable_submission(my_tx_payment_signed, client)

pprint(tx_response)

Traceback:

Traceback (most recent call last):
  File "cards-dealer.py", line 27, in <module>
    tx_response = send_reliable_submission(my_tx_payment_signed, client)
  File "/Users/mhamilton/Development/demos/venv/lib/python3.8/site-packages/xrpl/transaction/reliable_submission.py", line 32, in send_reliable_submission
    return asyncio.run(async_send_reliable_submission(transaction, client))
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/Users/mhamilton/Development/demos/venv/lib/python3.8/site-packages/xrpl/asyncio/transaction/reliable_submission.py", line 93, in send_reliable_submission
    return await _wait_for_final_transaction_outcome(
  File "/Users/mhamilton/Development/demos/venv/lib/python3.8/site-packages/xrpl/asyncio/transaction/reliable_submission.py", line 37, in _wait_for_final_transaction_outcome
    transaction_response = await get_transaction_from_hash(transaction_hash, client)
  File "/Users/mhamilton/Development/demos/venv/lib/python3.8/site-packages/xrpl/asyncio/transaction/ledger.py", line 50, in get_transaction_from_hash
    raise XRPLRequestFailureException(response.result)
xrpl.asyncio.clients.exceptions.XRPLRequestFailureException: Request failed, txnNotFound: Transaction not found.

from xrpl-py.

khancode avatar khancode commented on June 15, 2024

I'm getting this same failure too. Code that reproduces it:

from xrpl.clients import JsonRpcClient
from xrpl.wallet.main import Wallet
from xrpl.models.requests import AccountNFTs
from xrpl.models.transactions import Memo, NFTokenCancelOffer, NFTokenMint
from xrpl.transaction import safe_sign_and_autofill_transaction
from xrpl.transaction import send_reliable_submission
from xrpl.utils import drops_to_xrp, hex_to_str, str_to_hex


client = JsonRpcClient("http://xls20-sandbox.rippletest.net:51234")

# rBYSPwS3zvB2wu1nb5rxvU5gSuh5qgYW8V                                                                                                                           
wallet = Wallet("sh69ae5M5k7JhYpMmCoPVAz27456p", 0)

mint_args = {
    "account": "rBYSPwS3zvB2wu1nb5rxvU5gSuh5qgYW8V",
    "flags": 8,
    "uri": "",
    "memos": [Memo.from_dict({"memo_data": str_to_hex("Minted by Dealer")})],
    "transfer_fee": 0,
    "token_taxon": 0,
}

mint = NFTokenMint.from_dict(mint_args)
my_tx_payment_signed = safe_sign_and_autofill_transaction(mint, wallet, client)
tx_response = send_reliable_submission(my_tx_payment_signed, client)

pprint(tx_response)

Traceback:

Traceback (most recent call last):
  File "cards-dealer.py", line 27, in <module>
    tx_response = send_reliable_submission(my_tx_payment_signed, client)
  File "/Users/mhamilton/Development/demos/venv/lib/python3.8/site-packages/xrpl/transaction/reliable_submission.py", line 32, in send_reliable_submission
    return asyncio.run(async_send_reliable_submission(transaction, client))
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/Users/mhamilton/Development/demos/venv/lib/python3.8/site-packages/xrpl/asyncio/transaction/reliable_submission.py", line 93, in send_reliable_submission
    return await _wait_for_final_transaction_outcome(
  File "/Users/mhamilton/Development/demos/venv/lib/python3.8/site-packages/xrpl/asyncio/transaction/reliable_submission.py", line 37, in _wait_for_final_transaction_outcome
    transaction_response = await get_transaction_from_hash(transaction_hash, client)
  File "/Users/mhamilton/Development/demos/venv/lib/python3.8/site-packages/xrpl/asyncio/transaction/ledger.py", line 50, in get_transaction_from_hash
    raise XRPLRequestFailureException(response.result)
xrpl.asyncio.clients.exceptions.XRPLRequestFailureException: Request failed, txnNotFound: Transaction not found.

@hammertoe I debugged your code and found the submitted transaction's engine_result is temMALFORMED; so it looks like your transaction was malformed. I changed the uri param to be non-empty string and it worked:

"uri": str_to_hex("NFT mint test")

@aditya-stb Therefore, I believe this bug is reproduced when waiting for the final outcome on a submitted malformed transaction. Going to create a PR that verifies a submitted transaction is valid (not malformed) before waiting for its final outcome.

from xrpl-py.

khancode avatar khancode commented on June 15, 2024

Closing this issue. Feel free to reopen if you can still reproduce this issue.

from xrpl-py.

jonathanlei avatar jonathanlei commented on June 15, 2024

race condition issue checked and solved (4 api calls till raising error) #500

from xrpl-py.

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.