Skip to content
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
32 changes: 23 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,3 @@ endif # ENABLE_NEXT_PROTOCOL_VERSION_UNSAFE_FOR_PRODUCTION
if ENABLE_FASTDEV_UNSAFE_FOR_PRODUCTION
AM_CPPFLAGS += -DENABLE_FASTDEV_UNSAFE_FOR_PRODUCTION
endif # ENABLE_FASTDEV_UNSAFE_FOR_PRODUCTION

if CAP_0083
AM_CPPFLAGS += -DCAP_0083
endif

if CAP_0085_EXECUTABLE_REF
AM_CPPFLAGS += -DCAP_0085_EXECUTABLE_REF
endif
6 changes: 0 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -581,12 +581,6 @@ AS_IF([test "x$enable_fastdev_unsafe_for_production" = "xyes"], [
AM_CONDITIONAL(ENABLE_NEXT_PROTOCOL_VERSION_UNSAFE_FOR_PRODUCTION,
[test x$enable_next_protocol_version_unsafe_for_production = xyes])

AM_CONDITIONAL(CAP_0083,
[test x$enable_next_protocol_version_unsafe_for_production = xyes])

AM_CONDITIONAL(CAP_0085_EXECUTABLE_REF,
[test x$enable_next_protocol_version_unsafe_for_production = xyes])

AC_PATH_PROG(CARGO, cargo)
if test x"$CARGO" = x; then
AC_MSG_ERROR([cannot find cargo, needed for rust code])
Expand Down
8 changes: 1 addition & 7 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,6 @@ BUILT_SOURCES = $(SRC_X_FILES:.x=.h) $(GENERATED_VERSION_SOURCES) $(TEST_FILES)

$(SRC_X_FILES:.x=.h): $(XDRC)
XDR_FEATURE_FLAGS =
if CAP_0083
XDR_FEATURE_FLAGS += -DCAP_0083
endif
if CAP_0085_EXECUTABLE_REF
XDR_FEATURE_FLAGS += -DCAP_0085_EXECUTABLE_REF
endif

SUFFIXES = .x .h .rs
.x.h:
Expand Down Expand Up @@ -231,7 +225,7 @@ ALL_SOROBAN_PROTOCOLS=p27 p28
else
ALL_SOROBAN_PROTOCOLS=p21 p22 p23 p24 p25 p26 p27 p28
endif
WIP_SOROBAN_PROTOCOL=p28
WIP_SOROBAN_PROTOCOL=

CARGO_XDR_FEATURE_FLAGS =

Expand Down
2 changes: 0 additions & 2 deletions src/catchup/ApplyCheckpointWork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ ApplyCheckpointWork::getNextLedgerCloseData()
}
#endif

#ifdef CAP_0083
// Empty-tx-set values should have the empty-tx-set hash (and vice versa)
if ((header.scpValue.txSetHash == Herder::EMPTY_TX_SET_HASH) !=
(header.scpValue.ext.v() == STELLAR_VALUE_EMPTY_TX_SET))
Expand All @@ -285,7 +284,6 @@ ApplyCheckpointWork::getNextLedgerCloseData()
"hash and StellarValue type {:d}"),
header.ledgerSeq, static_cast<int32_t>(header.scpValue.ext.v())));
}
#endif // CAP_0083

// We've verified the ledgerHeader (in the "trusted part of history"
// sense) in CATCHUP_VERIFY phase; we now need to check that the
Expand Down
6 changes: 0 additions & 6 deletions src/herder/HerderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,9 @@ HerderImpl::processExternalized(uint64 slotIndex, StellarValue const& value,
TxSetXDRFrameConstPtr externalizedSet;
if (std::holds_alternative<EmptyTxSet>(result))
{
#ifdef CAP_0083
auto const& ov = value.ext.proposedValue();
externalizedSet = TxSetXDRFrame::makeEmpty(ov.previousLedgerHash,
ov.previousLedgerVersion);
#else
releaseAssert(false);
#endif // CAP_0083
}
else
{
Expand Down Expand Up @@ -2913,7 +2909,6 @@ HerderImpl::verifyStellarValueSignature(StellarValue const& sv)
sv.txSetHash,
sv.closeTime))
.valid;
#ifdef CAP_0083
case STELLAR_VALUE_EMPTY_TX_SET:
{
auto const& ov = sv.ext.proposedValue();
Expand All @@ -2924,7 +2919,6 @@ HerderImpl::verifyStellarValueSignature(StellarValue const& sv)
sv.closeTime))
.valid;
}
#endif // CAP_0083
default:
releaseAssert(false);
}
Expand Down
10 changes: 0 additions & 10 deletions src/herder/HerderSCPDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ namespace
bool
isEmptyTxSetStellarValue(StellarValue const& sv)
{
#ifdef CAP_0083
return sv.ext.v() == STELLAR_VALUE_EMPTY_TX_SET;
#else
return false;
#endif
}
}

Expand Down Expand Up @@ -315,7 +311,6 @@ HerderSCPDriver::validatePastOrFutureValue(
slotIndex, b.closeTime, lcl.header.scpValue.closeTime);
return SCPDriver::kInvalidValue;
}
#ifdef CAP_0083
if (isEmptyTxSetStellarValue(b))
{
if (!protocolAllowsEmptyTxSetValues())
Expand All @@ -338,7 +333,6 @@ HerderSCPDriver::validatePastOrFutureValue(
return SCPDriver::kInvalidValue;
}
}
#endif // CAP_0083
}
else if (slotIndex < lcl.header.ledgerSeq)
{
Expand Down Expand Up @@ -423,7 +417,6 @@ HerderSCPDriver::validateValueAgainstLocalState(uint64_t slotIndex,
return SCPDriver::kInvalidValue;
}

#ifdef CAP_0083
// For empty-tx-set values, validate that the previous ledger context
// matches our LCL. Empty-tx-set values don't have a real tx set to
// validate.
Expand Down Expand Up @@ -456,7 +449,6 @@ HerderSCPDriver::validateValueAgainstLocalState(uint64_t slotIndex,
}
return SCPDriver::kFullyValidatedValue;
}
#endif // CAP_0083

Hash const& txSetHash = b.txSetHash;
// Empty-tx-set values return early above, so this only runs for
Expand Down Expand Up @@ -688,7 +680,6 @@ HerderSCPDriver::getValueString(Value const& v) const
}
}

#ifdef CAP_0083
Value
HerderSCPDriver::makeEmptyTxSetValueFromValue(Value const& v) const
{
Expand All @@ -709,7 +700,6 @@ HerderSCPDriver::makeEmptyTxSetValueFromValue(Value const& v) const
proposedValue.ext.lcValueSignature();
return xdr::xdr_to_opaque(sv);
}
#endif

bool
HerderSCPDriver::isEmptyTxSetValue(Value const& v) const
Expand Down
2 changes: 0 additions & 2 deletions src/herder/HerderSCPDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,12 @@ class HerderSCPDriver : public SCPDriver
std::string toShortString(NodeID const& pk) const override;
std::string getValueString(Value const& v) const override;

#ifdef CAP_0083
// Construct a CAP-0083 empty-tx-set value from `v`. A few caveats about
// this function:
// * `v` must be a STELLAR_VALUE_SIGNED value.
// * This function should only be called from slots with slot indices equal
// to LCL+1
Value makeEmptyTxSetValueFromValue(Value const& v) const override;
#endif

// Returns true iff `v` is a CAP-0083 empty-tx-set value
bool isEmptyTxSetValue(Value const& v) const override;
Expand Down
2 changes: 0 additions & 2 deletions src/herder/LedgerCloseData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,10 @@ stellarValueToString(Config const& c, StellarValue const& sv)
case STELLAR_VALUE_SIGNED:
res << " SIGNED@" << c.toShortString(sv.ext.lcValueSignature().nodeID);
break;
#ifdef CAP_0083
case STELLAR_VALUE_EMPTY_TX_SET:
res << " EMPTY_TXSET@"
<< c.toShortString(sv.ext.proposedValue().lcValueSignature.nodeID);
break;
#endif
default:
res << " UNKNOWN";
break;
Expand Down
2 changes: 0 additions & 2 deletions src/herder/PendingEnvelopes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,9 @@ PendingEnvelopes::recvSCPEnvelope(SCPEnvelope const& envelope)
case STELLAR_VALUE_SIGNED:
// Signed values are allowed
return false;
#ifdef CAP_0083
case STELLAR_VALUE_EMPTY_TX_SET:
return !mHerder.getHerderSCPDriver()
.protocolAllowsEmptyTxSetValues();
#endif
default:
releaseAssert(false);
}
Expand Down
16 changes: 3 additions & 13 deletions src/herder/test/HerderTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2979,7 +2979,6 @@ testSCPDriver(uint32 protocolVersion, uint32_t maxTxSetSize, size_t expectedOps)
checkInvalidMismatch(sv);
}

#ifdef CAP_0083
SECTION("empty-tx-set value without empty-tx-set hash")
{
auto p = makeTxPair(herder, txSet0, ct);
Expand All @@ -2990,10 +2989,8 @@ testSCPDriver(uint32 protocolVersion, uint32_t maxTxSetSize, size_t expectedOps)
sv.txSetHash = txSet0->getContentsHash();
checkInvalidMismatch(sv);
}
#endif // CAP_0083
}

#ifdef CAP_0083
SECTION("valid empty-tx-set value")
{
auto p = makeTxPair(herder, txSet0, ct);
Expand All @@ -3015,7 +3012,6 @@ testSCPDriver(uint32 protocolVersion, uint32_t maxTxSetSize, size_t expectedOps)
/*nomination=*/true) ==
SCPDriver::kInvalidValue);
}
#endif // CAP_0083
}

SECTION("validateValue closeTimes")
Expand Down Expand Up @@ -3118,14 +3114,10 @@ testSCPDriver(uint32 protocolVersion, uint32_t maxTxSetSize, size_t expectedOps)

// Triggering next ledger will construct and cache the block
herder.triggerNextLedger(seq, true);
#ifdef CAP_0083
// All hits during the whole SCP round. If CAP-0083 support is compiled
// in, we expect 1 more cache hit for the validity check that determines
// whether or not to replace the transaction set with an empty one.
// All hits during the whole SCP round. One of them is the validity
// check that determines whether or not to replace the transaction set
// with an empty one (CAP-0083).
uint64_t const expectedHits = 11;
#else
uint64_t const expectedHits = 10;
#endif
REQUIRE(cache.getCounters().mHits == expectedHits);
// One miss from the initial makeTxSetFromTransactions
REQUIRE(cache.getCounters().mMisses == 1);
Expand Down Expand Up @@ -9109,7 +9101,6 @@ TEST_CASE_VERSIONS("Herder properly validates when tx set is missing",
});
}

#ifdef CAP_0083
// This tests that the network externalizes an empty-tx-set value when a
// voted-for value is not available on the network.
TEST_CASE("network externalizes empty-tx-set on missing value", "[herder][tx]")
Expand Down Expand Up @@ -9280,7 +9271,6 @@ TEST_CASE("SCP state restore with missing tx set", "[herder]")
REQUIRE(prep.ballot.value == emptyValue);
}
}
#endif // CAP_0083

static bool
triggerTimerProtocolSupported()
Expand Down
2 changes: 0 additions & 2 deletions src/herder/test/PendingEnvelopesTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,6 @@ TEST_CASE_VERSIONS("PendingEnvelopes recvSCPEnvelope", "[herder]")
Herder::ENVELOPE_STATUS_DISCARDED);
}

#ifdef CAP_0083
SECTION("empty-tx-set value envelopes gated by "
"EMPTY_TX_SET_PROTOCOL_VERSION")
{
Expand Down Expand Up @@ -545,7 +544,6 @@ TEST_CASE_VERSIONS("PendingEnvelopes recvSCPEnvelope", "[herder]")
});
}
}
#endif // CAP_0083

SECTION("can receive malformed tx set")
{
Expand Down
2 changes: 0 additions & 2 deletions src/history/test/HistoryTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,6 @@ TEST_CASE("History catchup with extra validation", "[history][publish]")
REQUIRE(catchupSimulation.catchupOffline(app, checkpointLedger, true));
}

#ifdef CAP_0083
TEST_CASE("History catchup over empty-tx-set ledgers", "[history][catchup]")
{
CatchupSimulation catchupSimulation{};
Expand Down Expand Up @@ -1325,7 +1324,6 @@ TEST_CASE("ApplyCheckpointWork rejects malformed empty-tx-set ledger headers",
}) == BasicWork::State::WORK_FAILURE);
}
}
#endif // CAP_0083

TEST_CASE("Publish works correctly post shadow removal", "[history]")
{
Expand Down
2 changes: 0 additions & 2 deletions src/history/test/HistoryTestsUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,6 @@ CatchupSimulation::generateRandomLedger(uint32_t version)
stroopySeqs.push_back(stroopy.loadSequenceNumber());
}

#ifdef CAP_0083
void
CatchupSimulation::generateEmptyTxSetLedger()
{
Expand Down Expand Up @@ -834,7 +833,6 @@ CatchupSimulation::generateEmptyTxSetLedger()
eveSeqs.push_back(eve.loadSequenceNumber());
stroopySeqs.push_back(stroopy.loadSequenceNumber());
}
#endif // CAP_0083

void
CatchupSimulation::setUpgradeLedger(uint32_t ledger,
Expand Down
Loading
Loading