Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable server-side tx "sanity checks" #1659

Merged
merged 1 commit into from
Feb 4, 2024
Merged
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
10 changes: 0 additions & 10 deletions src/rpc/core_rpc_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
#include "cryptonote_basic/cryptonote_format_utils.h"
#include "cryptonote_basic/account.h"
#include "cryptonote_basic/cryptonote_basic_impl.h"
#include "cryptonote_core/tx_sanity_check.h"
#include "cryptonote_core/uptime_proof.h"
#include "net/parse.h"
#include "crypto/hash.h"
Expand Down Expand Up @@ -1158,15 +1157,6 @@ namespace cryptonote { namespace rpc {
}
auto tx_blob = oxenc::from_hex(req.tx_as_hex);

if (req.do_sanity_checks && !cryptonote::tx_sanity_check(tx_blob, m_core.get_blockchain_storage().get_num_mature_outputs(0)))
{
res.status = "Failed";
res.reason = "Sanity check failed";
res.sanity_check_failed = true;
return res;
}
res.sanity_check_failed = false;

if (req.blink)
{
auto future = m_core.handle_blink_tx(tx_blob);
Expand Down
1 change: 0 additions & 1 deletion src/rpc/core_rpc_server_commands_defs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ KV_SERIALIZE_MAP_CODE_END()
KV_SERIALIZE_MAP_CODE_BEGIN(SEND_RAW_TX::request)
KV_SERIALIZE(tx_as_hex)
KV_SERIALIZE_OPT(do_not_relay, false)
KV_SERIALIZE_OPT(do_sanity_checks, true)
KV_SERIALIZE_OPT(blink, false)
KV_SERIALIZE_MAP_CODE_END()

Expand Down
1 change: 0 additions & 1 deletion src/rpc/core_rpc_server_commands_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,6 @@ namespace rpc {
{
std::string tx_as_hex; // Full transaction information as hexidecimal string.
bool do_not_relay; // (Optional: Default false) Stop relaying transaction to other nodes. Ignored if `blink` is true.
bool do_sanity_checks; // (Optional: Default true) Verify TX params have sane values.
bool blink; // (Optional: Default false) Submit this as a blink tx rather than into the mempool.

KV_MAP_SERIALIZABLE
Expand Down
1 change: 0 additions & 1 deletion src/wallet/wallet2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6936,7 +6936,6 @@ void wallet2::commit_tx(pending_tx& ptx, bool blink)
rpc::SEND_RAW_TX::request req{};
req.tx_as_hex = oxenc::to_hex(tx_to_blob(ptx.tx));
req.do_not_relay = false;
req.do_sanity_checks = true;
req.blink = blink;
rpc::SEND_RAW_TX::response daemon_send_resp{};
bool r = invoke_http<rpc::SEND_RAW_TX>(req, daemon_send_resp);
Expand Down