From b84bd3bdcfc022a950b154560c49accb92ac8da9 Mon Sep 17 00:00:00 2001 From: Siddharth Suresh Date: Tue, 22 Jul 2025 16:33:47 -0700 Subject: [PATCH] Update tx queue memo filtering --- src/herder/TransactionQueue.cpp | 32 +++-------------------- src/herder/test/TransactionQueueTests.cpp | 2 +- 2 files changed, 5 insertions(+), 29 deletions(-) diff --git a/src/herder/TransactionQueue.cpp b/src/herder/TransactionQueue.cpp index c1cdcc79c7..349afa6f32 100644 --- a/src/herder/TransactionQueue.cpp +++ b/src/herder/TransactionQueue.cpp @@ -308,38 +308,14 @@ validateSorobanMemo(TransactionFrameBasePtr tx) return true; } - bool isSourceAccountAuthOnly = true; - - auto const& auth = op.body.invokeHostFunctionOp().auth; - for (auto const& authEntry : auth) - { - if (authEntry.credentials.type() != - SorobanCredentialsType::SOROBAN_CREDENTIALS_SOURCE_ACCOUNT) - { - isSourceAccountAuthOnly = false; - break; - } - } - - if (isSourceAccountAuthOnly) - { - return true; - } - - // If tx has a memo or the source account is muxed if (txEnv.tx.memo.type() != MemoType::MEMO_NONE || - txEnv.tx.sourceAccount.type() == CryptoKeyType::KEY_TYPE_MUXED_ED25519) + txEnv.tx.sourceAccount.type() == + CryptoKeyType::KEY_TYPE_MUXED_ED25519 || + (op.sourceAccount && + op.sourceAccount->type() == CryptoKeyType::KEY_TYPE_MUXED_ED25519)) { return false; } - - // If op source account is muxed - if (op.sourceAccount && - op.sourceAccount->type() == CryptoKeyType::KEY_TYPE_MUXED_ED25519) - { - return false; - } - return true; } diff --git a/src/herder/test/TransactionQueueTests.cpp b/src/herder/test/TransactionQueueTests.cpp index 744456ab54..4a61334c21 100644 --- a/src/herder/test/TransactionQueueTests.cpp +++ b/src/herder/test/TransactionQueueTests.cpp @@ -1187,7 +1187,7 @@ TEST_CASE("Soroban tx and memos", "[soroban][transactionqueue]") uploadResourceFee + 100, uploadResourceFee, "memo"); REQUIRE(app->getHerder().recvTransaction(txWithMemo, false).code == - TransactionQueue::AddResultCode::ADD_STATUS_PENDING); + TransactionQueue::AddResultCode::ADD_STATUS_ERROR); } SECTION("non-source auth tx with memo")