UNLReport working

This commit is contained in:
Richard Holland
2023-06-15 09:45:11 +00:00
parent c33e64fa3d
commit 95bef7ced3
5 changed files with 14 additions and 6 deletions

View File

@@ -117,7 +117,7 @@ NegativeUNLVote::addReportingTx(
active.reserve(scoreTable.size());
for (auto const& [n, score]: scoreTable)
{
if (score > 240)
if (score > (FLAG_LEDGER_INTERVAL>>1))
{
active.emplace_back(sfActiveValidator);
active.back().setFieldVL(sfPublicKey, nidToKeyMap.at(n));
@@ -130,6 +130,7 @@ NegativeUNLVote::addReportingTx(
obj.setFieldU32(sfLedgerSequence, seq);
});
uint256 txID = repUnlTx.getTransactionID();
Serializer s;
repUnlTx.add(s);
@@ -143,7 +144,9 @@ NegativeUNLVote::addReportingTx(
else
{
JLOG(j_.debug()) << "R-UNL: ledger seq=" << seq
<< ", add a ttUNL_REPORT Tx with txID: " << txID;
<< ", add a ttUNL_REPORT Tx with txID: " << txID
<< ", size=" << s.size()
<< ", " << repUnlTx.getJson(JsonOptions::none);
}
}

View File

@@ -175,12 +175,14 @@ Change::applyUNLReport()
{
auto sle = view().peek(keylet::UNLReport());
bool const created = !!sle;
bool const created = !sle;
if (created)
sle = std::make_shared<SLE>(keylet::UNLReport());
sle->setFieldArray(sfActiveValidators, ctx_.tx.getFieldArray(sfActiveValidators));
auto const av = ctx_.tx.getFieldArray(sfActiveValidators);
sle->setFieldArray(sfActiveValidators, av);
if (created)
view().insert(sle);

View File

@@ -446,6 +446,7 @@ LedgerEntryTypesMatch::visitEntry(
case ltNFTOKEN_OFFER:
case ltURI_TOKEN:
case ltIMPORT_VLSEQ:
case ltUNL_REPORT:
break;
default:
invalidTypeAdded_ = true;

View File

@@ -37,7 +37,7 @@ namespace ripple {
@ingroup protocol
*/
/** Smallest legal byte size of a transaction. */
std::size_t constexpr txMinSizeBytes = 32;
std::size_t constexpr txMinSizeBytes = 10;
/** Largest legal byte size of a transaction. */
std::size_t constexpr txMaxSizeBytes = megabytes(1);

View File

@@ -301,7 +301,9 @@ LedgerFormats::LedgerFormats()
add(jss::UNLReport,
ltUNL_REPORT,
{
{sfActiveValidators, soeREQUIRED},
{sfActiveValidators, soeREQUIRED},
{sfPreviousTxnID, soeREQUIRED},
{sfPreviousTxnLgrSeq, soeREQUIRED},
},
commonFields);