Skip to content

Commit cd96730

Browse files
committed
Let the highest linked host cover its base protocol, re-record next baseline
With core at protocol 28 and no p29 submodule, a vnext build has the p28 host reporting 29, so protocol 28 had no exact linked host and isProtocolBackedByLinkedSorobanHost rejected it -- failing 70 of 131 [tx] cases. rs-soroban-env explicitly supports this: Host::maybe_check_protocol_version bypasses its protocol check under "next" because "a 'next' host can be used as the current host for both its base protocol and the next one", and ParsedModule's meta-section check does the same. Accept the highest linked host for protocolVersion + 1 on that basis. Restricting it to the highest host keeps fastdev's collapse of historical protocols onto a newer host detectable, which is what the exact-match rule is there to catch. Uncomment moduleCacheProtocolCount -= 1 in "Module cache across protocol versions", as that test's own comment instructs when the next protocol points at another copy of the current host: soroban_module_cache.rs routes 29 to p28_cache, so 29 adds no cache of its own. Re-record test-tx-meta-baseline-next, which recorded protocol 28 and now records 29. All 131 [tx] cases pass.
1 parent c99e7e3 commit cd96730

31 files changed

Lines changed: 22940 additions & 1581 deletions

src/test/TestUtils.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,20 @@ isProtocolBackedByLinkedSorobanHost(uint32_t protocolVersion,
4747
return false;
4848
}
4949

50+
// The highest linked host may be a "next" build, which reports one protocol
51+
// above its base and is designed to serve both: see the "next" bypasses in
52+
// rs-soroban-env's Host::maybe_check_protocol_version ("a 'next' host can
53+
// be used as the current host for both its base protocol and the next one")
54+
// and in ParsedModule's meta-section check. Accept that host for its base
55+
// protocol. Restricting this to the highest host keeps fastdev's collapse of
56+
// historical protocols onto a newer host detectable, which is what the
57+
// exact-match rule below exists to catch.
58+
if (selectedHost + 1 == hostProtocols.end() &&
59+
*selectedHost == protocolVersion + 1)
60+
{
61+
return true;
62+
}
63+
5064
// Protocol 20 is serviced by the p21 host. All later Soroban protocols
5165
// should have their own linked host in non-fastdev builds.
5266
return protocolVersion == static_cast<uint32_t>(SOROBAN_PROTOCOL_VERSION)

src/transactions/test/InvokeHostFunctionTests.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7788,7 +7788,9 @@ TEST_CASE("Module cache across protocol versions", "[tx][soroban][modulecache]")
77887788
// work-in-progress next host, in which case there _is_ a separate module
77897789
// cache and the following line of code should be commented-out.
77907790
//
7791-
// moduleCacheProtocolCount -= 1;
7791+
// There is no work-in-progress next host right now: soroban_module_cache.rs
7792+
// directs protocol 29 to p28_cache, so 29 contributes no cache of its own.
7793+
moduleCacheProtocolCount -= 1;
77927794
#endif
77937795
REQUIRE(app->getLedgerManager()
77947796
.getSorobanMetrics()

0 commit comments

Comments
 (0)