From 83891c469aad20d044c0284e38fda9a1fe834206 Mon Sep 17 00:00:00 2001 From: Tom Pointon Date: Thu, 25 Aug 2022 09:37:44 +0000 Subject: [PATCH 1/2] Only add one pending update per batch transaction --- pc/request.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pc/request.cpp b/pc/request.cpp index 2e17e7ced..8ece83211 100644 --- a/pc/request.cpp +++ b/pc/request.cpp @@ -815,12 +815,12 @@ bool price::send( price *prices[], const unsigned n ) } else { p->get_rpc_client()->send( &upds_[ 0 ], upds_.size(), mgr->get_requested_upd_price_cu_units(), mgr->get_requested_upd_price_cu_price() ); + p->tvec_.emplace_back( + std::string( 100, '\0' ), p->preq_->get_sent_time() + ); + p->preq_->get_signature()->enc_base58( p->tvec_.back().first ); for ( unsigned k = j; k <= i; ++k ) { price *const p1 = prices[ k ]; - p1->tvec_.emplace_back( - std::string( 100, '\0' ), p1->preq_->get_sent_time() - ); - p1->preq_->get_signature()->enc_base58( p1->tvec_.back().first ); PC_LOG_DBG( "sent price update" ) .add( "secondary", mgr->get_is_secondary() ) .add( "price_account", *p1->get_account() ) From 0131a44877fe11a2b5f7f7dfa6bc34fe39294dfb Mon Sep 17 00:00:00 2001 From: Tom Pointon Date: Thu, 25 Aug 2022 09:42:44 +0000 Subject: [PATCH 2/2] Log the correct signature and pub_slot for batched updates --- pc/request.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pc/request.cpp b/pc/request.cpp index 8ece83211..a563d57f3 100644 --- a/pc/request.cpp +++ b/pc/request.cpp @@ -827,8 +827,8 @@ bool price::send( price *prices[], const unsigned n ) .add( "product_account", *p1->prod_->get_account() ) .add( "symbol", p1->get_symbol() ) .add( "price_type", price_type_to_str( p1->get_price_type() ) ) - .add( "sig", p1->tvec_.back().first ) - .add( "pub_slot", p1->preq_->get_slot() ) + .add( "sig", p->tvec_.back().first ) + .add( "pub_slot", p->preq_->get_slot() ) .end(); if ( PC_UNLIKELY( p1->tvec_.size() >= 100 ) ) { PC_LOG_WRN( "too many unacked price update transactions" )