rippled
rippled copied to clipboard
WalletSize field is ignored
Issue Description
The WalletSize
and WalletLocator
fields were originally intended for use with content-addressable storage. They've both been labeled deprecated for a long time, but WalletLocator
actually works as an arbitrary 256-bit value that you can set, for example to reference some kind of IPFS document, so we could make it available by simply changing the documentation and leaving the implementation intact. The WalletSize
field, on the other hand, appears to be ignored by the AccountSet transactor.
Steps to Reproduce
-
Fund a new address
-
Send the following transaction, auto-filling fields as appropriate and using the address of your funded address from step 1:
{ "Account": YOUR_ADDRESS_HERE, "TransactionType": "AccountSet", "WalletLocator": "F1607C25DC3660C878802A69C8EF8E11AE62172F3A6C40F5C6CD85AB5E407A87", "WalletSize": 14 }
(If you're curious, the hash is the SHA512half of "mDuo13 is cool" and the size is the length of that string.)
-
Look up the transaction via
tx
. Look up the account viaaccount_info
.
Expected Result
I expected one of the following things to happen:
- The AccountRoot object would be updated with both new fields as set in the transaction
- The transaction would be considered malformed
- The fields would be discarded during signing and would not appear in the ledger, resulting in a no-op transaction
Actual Result
The transaction was confirmed and both fields are visible when looking it up, but only WalletLocator
was applied when processing the transaction.
Example tx response:
{
"id": 1,
"result": {
"Account": "rLnYB1Kym1Qa81Xpyz13Z4AEkbo4SHQzQ1",
"Fee": "12",
"Flags": 2147483648,
"LastLedgerSequence": 6898971,
"Sequence": 6898903,
"SigningPubKey": "02EF1A81A38C2FDAD7C1CF20052217176D08376BC58A20C772463A0591841BEC6B",
"TransactionType": "AccountSet",
"TxnSignature": "3045022100A2AD7D07D2DDE4DAF5C4508FC879207E96A6CB7F93AA37283A3E1B3692A7690D0220116990BF98E7E7A825409A6A56872E76A1BCFACF5AE616009A1B4DECCE0C7143",
"WalletLocator": "F1607C25DC3660C878802A69C8EF8E11AE62172F3A6C40F5C6CD85AB5E407A87",
"WalletSize": 14,
"date": 671250703,
"hash": "DCEE1BDA98DEACEFBC0F67695E0E30FD0673E142B94E7DC146A748A457EDD345",
"inLedger": 6898970,
"ledger_index": 6898970,
"meta": {
"AffectedNodes": [
{
"ModifiedNode": {
"FinalFields": {
"Account": "rLnYB1Kym1Qa81Xpyz13Z4AEkbo4SHQzQ1",
"Balance": "999999976",
"Flags": 0,
"OwnerCount": 10,
"Sequence": 6898904,
"TicketCount": 10,
"WalletLocator": "F1607C25DC3660C878802A69C8EF8E11AE62172F3A6C40F5C6CD85AB5E407A87"
},
"LedgerEntryType": "AccountRoot",
"LedgerIndex": "9148225AC86F0D1472F4D61C575D33B1250F6B058445488A2A60B7EB6CBF39DD",
"PreviousFields": {
"Balance": "999999988",
"Sequence": 6898903
},
"PreviousTxnID": "8C5D50C79B6F332328DE304F97015EAD88F1291B3FF9C9332A562F0F1627E295",
"PreviousTxnLgrSeq": 6898910
}
}
],
"TransactionIndex": 0,
"TransactionResult": "tesSUCCESS"
},
"validated": true
},
"status": "success",
"type": "response"
}
account_info response:
{
"id": 2,
"result": {
"account_data": {
"Account": "rLnYB1Kym1Qa81Xpyz13Z4AEkbo4SHQzQ1",
"Balance": "798999964",
"Flags": 0,
"LedgerEntryType": "AccountRoot",
"OwnerCount": 10,
"PreviousTxnID": "90EC5FA85BF9B752AB652B32B664EE505A8F0D99D0A129C47A4CE77F4875B3EB",
"PreviousTxnLgrSeq": 6898972,
"Sequence": 6898905,
"TicketCount": 10,
"WalletLocator": "F1607C25DC3660C878802A69C8EF8E11AE62172F3A6C40F5C6CD85AB5E407A87",
"index": "9148225AC86F0D1472F4D61C575D33B1250F6B058445488A2A60B7EB6CBF39DD"
},
"ledger_current_index": 6899018,
"queue_data": {
"txn_count": 0
},
"validated": false
},
"status": "success",
"type": "response"
}
(Note, the ticket count is because I happened to run through parts of the Use Tickets interactive tutorial in the process of running my test.)
Environment
Tested on Devnet (currently running v1.7.0, I think?)
Suggested Fix
I'd like to investigate mainnet data to see what values, if any, may have been set by legacy versions of the protocol. But I'd be happy with either declaring WalletSize
to be an invalid field on new transactions, or allowing it to be set on an AccountRoot object as an arbitrary 32-bit value that clients can use as they please. In either case, an amendment would be needed.