Skip to content

Commit fdd1ef1

Browse files
committed
Promote the p28 soroban host from next-only to current
Bumping CURRENT_LEDGER_PROTOCOL_VERSION to 28 is not enough on its own: p28 was wired throughout as a next-only host, so a plain build had no p28 host at all and aborted in check_sensible_soroban_config_for_protocol with max_host_module_proto (27) < core_max_proto (28). Ungates the p28 module itself, the soroban_curr alias, its HOST_MODULES entry, the two v1-unsupported stub macros it relies on, and its SorobanModuleCache field and dispatch arms. Clears WIP_SOROBAN_PROTOCOL, since p28 is no longer work-in-progress. That also means --features=next now reaches p28 (it is applied only to SOROBAN_MAX_PROTOCOL), so under a vnext build the same submodule reports protocol 29 and matches core's max of 29. The dispatch test is re-gated accordingly: 28 without the feature, 29 with it.
1 parent 59ff22d commit fdd1ef1

3 files changed

Lines changed: 9 additions & 18 deletions

File tree

src/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ ALL_SOROBAN_PROTOCOLS=p27 p28
225225
else
226226
ALL_SOROBAN_PROTOCOLS=p21 p22 p23 p24 p25 p26 p27 p28
227227
endif
228-
WIP_SOROBAN_PROTOCOL=p28
228+
WIP_SOROBAN_PROTOCOL=
229229

230230
CARGO_XDR_FEATURE_FLAGS =
231231

src/rust/src/soroban_module_cache.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use crate::{
2222
#[cfg(not(feature = "fastdev"))]
2323
use crate::soroban_proto_all::{p23, p24, p25, p26};
2424

25-
#[cfg(feature = "next")]
2625
use crate::soroban_proto_all::p28;
2726

2827
pub(crate) struct SorobanModuleCache {
@@ -35,7 +34,6 @@ pub(crate) struct SorobanModuleCache {
3534
#[cfg(not(feature = "fastdev"))]
3635
pub(crate) p26_cache: p26::soroban_proto_any::ProtocolSpecificModuleCache,
3736
pub(crate) p27_cache: p27::soroban_proto_any::ProtocolSpecificModuleCache,
38-
#[cfg(feature = "next")]
3937
pub(crate) p28_cache: p28::soroban_proto_any::ProtocolSpecificModuleCache,
4038
}
4139

@@ -51,7 +49,6 @@ impl SorobanModuleCache {
5149
#[cfg(not(feature = "fastdev"))]
5250
p26_cache: p26::soroban_proto_any::ProtocolSpecificModuleCache::new()?,
5351
p27_cache: p27::soroban_proto_any::ProtocolSpecificModuleCache::new()?,
54-
#[cfg(feature = "next")]
5552
p28_cache: p28::soroban_proto_any::ProtocolSpecificModuleCache::new()?,
5653
})
5754
}
@@ -71,7 +68,6 @@ impl SorobanModuleCache {
7168
#[cfg(not(feature = "fastdev"))]
7269
26 => self.p26_cache.compile(_wasm),
7370
27 => self.p27_cache.compile(_wasm),
74-
#[cfg(feature = "next")]
7571
28 => self.p28_cache.compile(_wasm),
7672
// Add other protocols here as needed.
7773
_ => Err(protocol_agnostic::make_error("unsupported protocol")),
@@ -88,7 +84,6 @@ impl SorobanModuleCache {
8884
#[cfg(not(feature = "fastdev"))]
8985
p26_cache: self.p26_cache.shallow_clone()?,
9086
p27_cache: self.p27_cache.shallow_clone()?,
91-
#[cfg(feature = "next")]
9287
p28_cache: self.p28_cache.shallow_clone()?,
9388
}))
9489
}
@@ -107,7 +102,6 @@ impl SorobanModuleCache {
107102
#[cfg(not(feature = "fastdev"))]
108103
self.p26_cache.evict(&_hash)?;
109104
self.p27_cache.evict(&_hash)?;
110-
#[cfg(feature = "next")]
111105
self.p28_cache.evict(&_hash)?;
112106
Ok(())
113107
}
@@ -121,7 +115,6 @@ impl SorobanModuleCache {
121115
#[cfg(not(feature = "fastdev"))]
122116
self.p26_cache.clear()?;
123117
self.p27_cache.clear()?;
124-
#[cfg(feature = "next")]
125118
self.p28_cache.clear()?;
126119
Ok(())
127120
}
@@ -146,7 +139,6 @@ impl SorobanModuleCache {
146139
#[cfg(not(feature = "fastdev"))]
147140
26 => self.p26_cache.contains_module(&_hash),
148141
27 => self.p27_cache.contains_module(&_hash),
149-
#[cfg(feature = "next")]
150142
28 => self.p28_cache.contains_module(&_hash),
151143
_ => Err(protocol_agnostic::make_error("unsupported protocol")),
152144
}
@@ -167,7 +159,6 @@ impl SorobanModuleCache {
167159
#[cfg(not(feature = "fastdev"))]
168160
26 => bytes = bytes.max(self.p26_cache.get_wasm_bytes_input()?),
169161
27 => bytes = bytes.max(self.p27_cache.get_wasm_bytes_input()?),
170-
#[cfg(feature = "next")]
171162
28 => bytes = bytes.max(self.p28_cache.get_wasm_bytes_input()?),
172163
_ => return Err(protocol_agnostic::make_error("unsupported protocol")),
173164
}

src/rust/src/soroban_proto_all.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ use crate::RustBuf;
3232
// We also alias the latest soroban as soroban_curr to help reduce churn in code
3333
// that's just "always supposed to use the latest".
3434

35-
#[cfg(not(feature = "next"))]
36-
pub(crate) use p27 as soroban_curr;
37-
#[cfg(feature = "next")]
3835
pub(crate) use p28 as soroban_curr;
3936

4037
// We also pin some protocol _agnostic_ definitions that are technically
@@ -64,7 +61,6 @@ pub(crate) mod protocol_agnostic {
6461
// Each protocol module supports exactly one of them and has another one defined
6562
// as a never-called invoke_v1/2_unsupported stub.
6663

67-
#[cfg(feature = "next")]
6864
macro_rules! invoke_v1_unsupported_stub {
6965
() => {
7066
#[allow(unused_variables)]
@@ -134,7 +130,6 @@ macro_rules! invoke_v2_unsupported_stub {
134130
// Similar to the invoke stubs, we have two versions of the
135131
// wasm_module_memory_cost with different interfaces: pre-p28, and p28+.
136132

137-
#[cfg(feature = "next")]
138133
macro_rules! wasm_module_memory_cost_v1_unsupported_stub {
139134
() => {
140135
#[allow(unused_variables)]
@@ -181,7 +176,6 @@ macro_rules! ttl_ledger_entry_meta_stub {
181176
};
182177
}
183178

184-
#[cfg(feature = "next")]
185179
#[path = "."]
186180
pub(crate) mod p28 {
187181
pub(crate) extern crate soroban_env_host_p28;
@@ -1868,7 +1862,6 @@ const HOST_MODULES: &'static [HostModule] = &[
18681862
#[cfg(not(feature = "fastdev"))]
18691863
proto_versioned_functions_for_module!(p26),
18701864
proto_versioned_functions_for_module!(p27),
1871-
#[cfg(feature = "next")]
18721865
proto_versioned_functions_for_module!(p28),
18731866
];
18741867

@@ -1913,11 +1906,18 @@ fn protocol_dispatches_as_expected() {
19131906
assert_eq!(get_host_module_for_protocol(27, 27).unwrap().max_proto, 27);
19141907
}
19151908

1916-
#[cfg(all(feature = "fastdev", feature = "next"))]
1909+
// p28 is now built unconditionally. Without the "next" feature it reports
1910+
// protocol 28; with it, the same submodule reports 29.
1911+
#[cfg(not(feature = "next"))]
19171912
{
19181913
assert_eq!(get_host_module_for_protocol(28, 28).unwrap().max_proto, 28);
19191914
}
19201915

1916+
#[cfg(feature = "next")]
1917+
{
1918+
assert_eq!(get_host_module_for_protocol(29, 29).unwrap().max_proto, 29);
1919+
}
1920+
19211921
// No protocols past the max known.
19221922
let last_proto = HOST_MODULES.last().unwrap().max_proto;
19231923
assert!(get_host_module_for_protocol(last_proto + 1, last_proto + 1).is_err());

0 commit comments

Comments
 (0)