Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 4 additions & 28 deletions src/herder/TransactionQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Copilot AI Aug 20, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change modifies transaction validation logic that could affect fee bump transactions. Should we add or update tests for fee bump transactions to ensure they still work correctly with this new memo filtering behavior?

Copilot uses AI. Check for mistakes.
{
return false;
}

Copilot AI Aug 20, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The consolidated conditional check spans multiple lines and combines different validation concerns (memo, source account muxing, and operation source account muxing). Consider breaking this into separate checks or adding comments to clarify the validation logic for better readability.

Copilot uses AI. Check for mistakes.

// If op source account is muxed
if (op.sourceAccount &&
op.sourceAccount->type() == CryptoKeyType::KEY_TYPE_MUXED_ED25519)
{
return false;
}

return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/herder/test/TransactionQueueTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down