Skip to content

Commit

Permalink
Some clarifications
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderSuprunenko committed May 23, 2019
1 parent 097b363 commit 0e5619a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/supernode/requests/authorize_rta_tx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace graft::supernode::request {

GRAFT_DEFINE_IO_STRUCT_INITED(SupernodeSignature,
(std::string, id_key, std::string()),
(std::string, result_signature, std::string()), // signarure for tx_id + result
(std::string, result_signature, std::string()), // signature for tx_id + result
(std::string, tx_signature, std::string()) // signature for tx_id only
);

Expand Down
29 changes: 29 additions & 0 deletions src/supernode/requests/blockchain_based_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,31 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

/////////////// phases scheme
/// on the trigger of blockchain increased
/// n+1 -----------------------
/// get Blockchain-based List
/// get hash(es) of previous Blockchain-based List(s)
/// create BBQS & QCL from BBL
/// n+2 -----------------------
/// if the supernode in the QCL it Forward "multicast" MRME (self sing (SN ID | block_height)) to BBQS
/// n+3 -----------------------
/// if SN is in BBQS
/// make list of non-answered IDs (DL(n+1) = (QCL(n+1) - (answered IDs))
/// Forward "multicast" MRME (DL(n+)) to BBQS
/// n+4 -----------------------
/// if SN is in BBQS
/// make disqualification list with sign set of each item. (id (signes > 66% of BBQS))
/// create disqualification transaction (type 1)
/// send it to the blockchain
///
/// n+5 = (n+4) + 1
///
/// a handler that validates and collects "ping" responses (if SN is in BBQS) [n+1..n+3).
///
/// a handler that validates and collects DLs (if SN is in BBQS) [n+2..n+4).
///

#include "supernode/requests/blockchain_based_list.h"
#include "supernode/requestdefines.h"
#include "supernode/requests/multicast.h"
Expand Down Expand Up @@ -921,6 +946,10 @@ class BBLDisqualificatorTest : public BBLDisqualificator
forward.push_back(std::move(id));
}
}
else
{
forward.clear(); body.clear(); callback_uri.clear();
}
}
public:
static std::mutex m_err_mutex;
Expand Down
3 changes: 2 additions & 1 deletion test/disqualification_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct less_mem
};


TEST(Disqualificator, common)
TEST(Disqualificator, BBL)
{
using namespace graft::supernode::request;

Expand All @@ -58,6 +58,7 @@ TEST(Disqualificator, common)
std::deque<BBLDisqualificatorBase::command> deque;
};

//N - count or running SNs, DB - dead (never runnign) SNs that in BBQS, DQ - dead SNs that in QCL
const int N = 14, DB = 2, DQ = 3;
crypto::public_key pubs[N+DB+DQ];
crypto::secret_key secs[N+DB+DQ];
Expand Down

0 comments on commit 0e5619a

Please sign in to comment.