XRPLF / rippled

Decentralized cryptocurrency blockchain daemon implementing the XRP Ledger protocol in C++
https://xrpl.org
ISC License
4.48k stars 1.45k forks source link

Submitting the same Payment tx to ZERO_ADDRESS produces different engine result codes (Version: 2.0.0) #4914

Closed dzmitryhil closed 4 months ago

dzmitryhil commented 4 months ago

Issue Description

When I send a Payment transaction to the destination rrrrrrrrrrrrrrrrrrrrBZbvji (ACCOUNT_ONE special-addresses) first time the the node replies with the temBAD_PATH result code, and when I submit the same tx second time it replies with temBAD_SIGNATURE.

Steps to Reproduce

The code snippet with output shows all required steps.

if (typeof module !== "undefined") {
    var xrpl = require('xrpl')
}

async function main() {
    console.log("Connecting to Testnet...")
    const client = new xrpl.Client('wss://s.altnet.rippletest.net:51233')
    await client.connect()

    console.log("Requesting account credentials from the Testnet faucet, this may take awhile...")
    const {wallet: main_wallet} = await client.fundWallet()

    // https://xrpl.org/addresses.html#special-addresses
    // ACCOUNT_ONE
    const destination = "rrrrrrrrrrrrrrrrrrrrBZbvji"
    const payment_tx = {
        "TransactionType": "Payment",
        "Account": main_wallet.address,
        "Amount": {
            currency: "TST",
            issuer: main_wallet.address,
            value: "15"
        },
        "Destination": destination,
    }

    const payment_tx_prepared = await client.autofill(payment_tx)
    const {tx_blob: payment_tx_signed} = main_wallet.sign(payment_tx_prepared)

    console.log("Tx binary:", payment_tx_signed)
    console.log("Submitting the tx first time")
    let submitResponse = await client.submit(payment_tx_signed)
    console.log(`\t Tx result: ${submitResponse.result.engine_result}`)
    console.log("Submitting the tx second time")
    submitResponse = await client.submit(payment_tx_signed)
    console.log("\t Tx result:", submitResponse.result.engine_result)

    client.disconnect()
}

main()

Output:

Connecting to Testnet...
Requesting account credentials from the Testnet faucet, this may take awhile...
Tx binary: 12000022000000002402B3C992201B02B3C9A661D4C5543DF729C0000000000000000000000000005453540000000000F2C9C2AA8A1D1929B7D5912DD6470BE764839BEE68400000000000000C7321ED83B31632A831D0BDCDAEA7F6910F808C41103818131D8F580840B4445964E4F7744011E277F97554C2AA670F915D5E6334868792DC771AC3C1041C38CE3E1C61503897B1D8A266472F8BDB56E570A025EBA4AC1BBD55F11DD5172E65221FC67F6D0A8114F2C9C2AA8A1D1929B7D5912DD6470BE764839BEE83140000000000000000000000000000000000000001
Submitting the tx first time
         Tx result: temBAD_PATH
Submitting the tx second time
         Tx result: temBAD_SIGNATURE

Expected Result

Expected to receive the same result code for the transaction.

Environment

Reproducable with the XRPL testnet.

ximinez commented 4 months ago

Closing as a duplicate of https://github.com/XRPLF/rippled/issues/4075. Please see the explanations on that issue.

dzmitryhil commented 4 months ago

Thanks for the reference @ximinez

dzmitryhil commented 4 months ago

Duplicate of https://github.com/XRPLF/rippled/issues/4075