Skip to content

Commit 19eebd0

Browse files
authored
chore: bump stellar-xdr to v25.0. (#769)
1 parent 6b59dde commit 19eebd0

13 files changed

Lines changed: 135 additions & 69 deletions

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Pending
44
- feat: sort `ScMap` entries by key in `Scv.toMap` following Soroban runtime ordering rules, as the network requires ScMap keys to be in ascending order. `Scv.toMap` now accepts `Map<SCVal, SCVal>`; the previous `toMap(LinkedHashMap<SCVal, SCVal>)` overload is deprecated.
55
- feat: add `closeTime`, `headerXdr`, and `metadataXdr` to `GetLatestLedgerResponse`.
6+
- chore: bump [stellar-xdr](https://github.com/stellar/stellar-xdr) to v25.0.
67

78
## 2.2.3
89

Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# XDR files from https://github.com/stellar/stellar-xdr
22
XDRS = xdr/Stellar-SCP.x \
3-
xdr/Stellar-ledger-entries.x \
4-
xdr/Stellar-ledger.x \
5-
xdr/Stellar-overlay.x \
6-
xdr/Stellar-transaction.x \
7-
xdr/Stellar-types.x \
3+
xdr/Stellar-contract-config-setting.x \
84
xdr/Stellar-contract-env-meta.x \
95
xdr/Stellar-contract-meta.x \
106
xdr/Stellar-contract-spec.x \
117
xdr/Stellar-contract.x \
8+
xdr/Stellar-exporter.x \
129
xdr/Stellar-internal.x \
13-
xdr/Stellar-contract-config-setting.x \
14-
xdr/Stellar-exporter.x
10+
xdr/Stellar-ledger-entries.x \
11+
xdr/Stellar-ledger.x \
12+
xdr/Stellar-overlay.x \
13+
xdr/Stellar-transaction.x \
14+
xdr/Stellar-types.x
1515

1616
# stellar-xdr commit to use, see https://github.com/stellar/stellar-xdr
17-
XDR_COMMIT=4b7a2ef7931ab2ca2499be68d849f38190b443ca
17+
XDR_COMMIT=0a621ec7811db000a60efae5b35f78dee3aa2533
1818

1919
.PHONY: xdr xdr-clean xdr-update xdr-generator-test xdr-generator-update-snapshots
2020

src/main/java/org/stellar/sdk/xdr/ContractCostType.java

Lines changed: 78 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,38 @@
161161
* // Cost of performing BLS12-381 scalar element exponentiation
162162
* Bls12381FrPow = 68,
163163
* // Cost of performing BLS12-381 scalar element inversion
164-
* Bls12381FrInv = 69
164+
* Bls12381FrInv = 69,
165+
*
166+
* // Cost of encoding a BN254 Fp (base field element)
167+
* Bn254EncodeFp = 70,
168+
* // Cost of decoding a BN254 Fp (base field element)
169+
* Bn254DecodeFp = 71,
170+
* // Cost of checking a G1 point lies on the curve
171+
* Bn254G1CheckPointOnCurve = 72,
172+
* // Cost of checking a G2 point lies on the curve
173+
* Bn254G2CheckPointOnCurve = 73,
174+
* // Cost of checking a G2 point belongs to the correct subgroup
175+
* Bn254G2CheckPointInSubgroup = 74,
176+
* // Cost of converting a BN254 G1 point from projective to affine coordinates
177+
* Bn254G1ProjectiveToAffine = 75,
178+
* // Cost of performing BN254 G1 point addition
179+
* Bn254G1Add = 76,
180+
* // Cost of performing BN254 G1 scalar multiplication
181+
* Bn254G1Mul = 77,
182+
* // Cost of performing BN254 pairing operation
183+
* Bn254Pairing = 78,
184+
* // Cost of converting a BN254 scalar element from U256
185+
* Bn254FrFromU256 = 79,
186+
* // Cost of converting a BN254 scalar element to U256
187+
* Bn254FrToU256 = 80,
188+
* // // Cost of performing BN254 scalar element addition/subtraction
189+
* Bn254FrAddSub = 81,
190+
* // Cost of performing BN254 scalar element multiplication
191+
* Bn254FrMul = 82,
192+
* // Cost of performing BN254 scalar element exponentiation
193+
* Bn254FrPow = 83,
194+
* // Cost of performing BN254 scalar element inversion
195+
* Bn254FrInv = 84
165196
* };
166197
* </pre>
167198
*/
@@ -235,7 +266,22 @@ public enum ContractCostType implements XdrElement {
235266
Bls12381FrAddSub(66),
236267
Bls12381FrMul(67),
237268
Bls12381FrPow(68),
238-
Bls12381FrInv(69);
269+
Bls12381FrInv(69),
270+
Bn254EncodeFp(70),
271+
Bn254DecodeFp(71),
272+
Bn254G1CheckPointOnCurve(72),
273+
Bn254G2CheckPointOnCurve(73),
274+
Bn254G2CheckPointInSubgroup(74),
275+
Bn254G1ProjectiveToAffine(75),
276+
Bn254G1Add(76),
277+
Bn254G1Mul(77),
278+
Bn254Pairing(78),
279+
Bn254FrFromU256(79),
280+
Bn254FrToU256(80),
281+
Bn254FrAddSub(81),
282+
Bn254FrMul(82),
283+
Bn254FrPow(83),
284+
Bn254FrInv(84);
239285

240286
private final int value;
241287

@@ -392,6 +438,36 @@ public static ContractCostType decode(XdrDataInputStream stream, int maxDepth)
392438
return Bls12381FrPow;
393439
case 69:
394440
return Bls12381FrInv;
441+
case 70:
442+
return Bn254EncodeFp;
443+
case 71:
444+
return Bn254DecodeFp;
445+
case 72:
446+
return Bn254G1CheckPointOnCurve;
447+
case 73:
448+
return Bn254G2CheckPointOnCurve;
449+
case 74:
450+
return Bn254G2CheckPointInSubgroup;
451+
case 75:
452+
return Bn254G1ProjectiveToAffine;
453+
case 76:
454+
return Bn254G1Add;
455+
case 77:
456+
return Bn254G1Mul;
457+
case 78:
458+
return Bn254Pairing;
459+
case 79:
460+
return Bn254FrFromU256;
461+
case 80:
462+
return Bn254FrToU256;
463+
case 81:
464+
return Bn254FrAddSub;
465+
case 82:
466+
return Bn254FrMul;
467+
case 83:
468+
return Bn254FrPow;
469+
case 84:
470+
return Bn254FrInv;
395471
default:
396472
throw new IllegalArgumentException("Unknown enum value: " + value);
397473
}

src/main/java/org/stellar/sdk/xdr/SCSpecEventV0.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* string lib&lt;80&gt;;
2222
* SCSymbol name;
2323
* SCSymbol prefixTopics&lt;2&gt;;
24-
* SCSpecEventParamV0 params&lt;50&gt;;
24+
* SCSpecEventParamV0 params&lt;&gt;;
2525
* SCSpecEventDataFormat dataFormat;
2626
* };
2727
* </pre>
@@ -59,9 +59,6 @@ public void encode(XdrDataOutputStream stream) throws IOException {
5959
prefixTopics[i].encode(stream);
6060
}
6161
int paramsSize = getParams().length;
62-
if (paramsSize > 50) {
63-
throw new IOException("params size " + paramsSize + " exceeds max size 50");
64-
}
6562
stream.writeInt(paramsSize);
6663
for (int i = 0; i < paramsSize; i++) {
6764
params[i].encode(stream);
@@ -101,9 +98,6 @@ public static SCSpecEventV0 decode(XdrDataInputStream stream, int maxDepth) thro
10198
if (paramsSize < 0) {
10299
throw new IOException("params size " + paramsSize + " is negative");
103100
}
104-
if (paramsSize > 50) {
105-
throw new IOException("params size " + paramsSize + " exceeds max size 50");
106-
}
107101
int paramsRemainingInputLen = stream.getRemainingInputLen();
108102
if (paramsRemainingInputLen >= 0 && paramsRemainingInputLen < paramsSize) {
109103
throw new IOException(

src/main/java/org/stellar/sdk/xdr/SCSpecFunctionV0.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* {
2020
* string doc&lt;SC_SPEC_DOC_LIMIT&gt;;
2121
* SCSymbol name;
22-
* SCSpecFunctionInputV0 inputs&lt;10&gt;;
22+
* SCSpecFunctionInputV0 inputs&lt;&gt;;
2323
* SCSpecTypeDef outputs&lt;1&gt;;
2424
* };
2525
* </pre>
@@ -42,9 +42,6 @@ public void encode(XdrDataOutputStream stream) throws IOException {
4242
doc.encode(stream);
4343
name.encode(stream);
4444
int inputsSize = getInputs().length;
45-
if (inputsSize > 10) {
46-
throw new IOException("inputs size " + inputsSize + " exceeds max size 10");
47-
}
4845
stream.writeInt(inputsSize);
4946
for (int i = 0; i < inputsSize; i++) {
5047
inputs[i].encode(stream);
@@ -72,9 +69,6 @@ public static SCSpecFunctionV0 decode(XdrDataInputStream stream, int maxDepth)
7269
if (inputsSize < 0) {
7370
throw new IOException("inputs size " + inputsSize + " is negative");
7471
}
75-
if (inputsSize > 10) {
76-
throw new IOException("inputs size " + inputsSize + " exceeds max size 10");
77-
}
7872
int inputsRemainingInputLen = stream.getRemainingInputLen();
7973
if (inputsRemainingInputLen >= 0 && inputsRemainingInputLen < inputsSize) {
8074
throw new IOException(

src/main/java/org/stellar/sdk/xdr/SCSpecUDTEnumV0.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* string doc&lt;SC_SPEC_DOC_LIMIT&gt;;
2121
* string lib&lt;80&gt;;
2222
* string name&lt;60&gt;;
23-
* SCSpecUDTEnumCaseV0 cases&lt;50&gt;;
23+
* SCSpecUDTEnumCaseV0 cases&lt;&gt;;
2424
* };
2525
* </pre>
2626
*/
@@ -51,9 +51,6 @@ public void encode(XdrDataOutputStream stream) throws IOException {
5151
}
5252
name.encode(stream);
5353
int casesSize = getCases().length;
54-
if (casesSize > 50) {
55-
throw new IOException("cases size " + casesSize + " exceeds max size 50");
56-
}
5754
stream.writeInt(casesSize);
5855
for (int i = 0; i < casesSize; i++) {
5956
cases[i].encode(stream);
@@ -73,9 +70,6 @@ public static SCSpecUDTEnumV0 decode(XdrDataInputStream stream, int maxDepth) th
7370
if (casesSize < 0) {
7471
throw new IOException("cases size " + casesSize + " is negative");
7572
}
76-
if (casesSize > 50) {
77-
throw new IOException("cases size " + casesSize + " exceeds max size 50");
78-
}
7973
int casesRemainingInputLen = stream.getRemainingInputLen();
8074
if (casesRemainingInputLen >= 0 && casesRemainingInputLen < casesSize) {
8175
throw new IOException(

src/main/java/org/stellar/sdk/xdr/SCSpecUDTErrorEnumV0.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* string doc&lt;SC_SPEC_DOC_LIMIT&gt;;
2121
* string lib&lt;80&gt;;
2222
* string name&lt;60&gt;;
23-
* SCSpecUDTErrorEnumCaseV0 cases&lt;50&gt;;
23+
* SCSpecUDTErrorEnumCaseV0 cases&lt;&gt;;
2424
* };
2525
* </pre>
2626
*/
@@ -51,9 +51,6 @@ public void encode(XdrDataOutputStream stream) throws IOException {
5151
}
5252
name.encode(stream);
5353
int casesSize = getCases().length;
54-
if (casesSize > 50) {
55-
throw new IOException("cases size " + casesSize + " exceeds max size 50");
56-
}
5754
stream.writeInt(casesSize);
5855
for (int i = 0; i < casesSize; i++) {
5956
cases[i].encode(stream);
@@ -75,9 +72,6 @@ public static SCSpecUDTErrorEnumV0 decode(XdrDataInputStream stream, int maxDept
7572
if (casesSize < 0) {
7673
throw new IOException("cases size " + casesSize + " is negative");
7774
}
78-
if (casesSize > 50) {
79-
throw new IOException("cases size " + casesSize + " exceeds max size 50");
80-
}
8175
int casesRemainingInputLen = stream.getRemainingInputLen();
8276
if (casesRemainingInputLen >= 0 && casesRemainingInputLen < casesSize) {
8377
throw new IOException(

src/main/java/org/stellar/sdk/xdr/SCSpecUDTStructV0.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* string doc&lt;SC_SPEC_DOC_LIMIT&gt;;
2121
* string lib&lt;80&gt;;
2222
* string name&lt;60&gt;;
23-
* SCSpecUDTStructFieldV0 fields&lt;40&gt;;
23+
* SCSpecUDTStructFieldV0 fields&lt;&gt;;
2424
* };
2525
* </pre>
2626
*/
@@ -51,9 +51,6 @@ public void encode(XdrDataOutputStream stream) throws IOException {
5151
}
5252
name.encode(stream);
5353
int fieldsSize = getFields().length;
54-
if (fieldsSize > 40) {
55-
throw new IOException("fields size " + fieldsSize + " exceeds max size 40");
56-
}
5754
stream.writeInt(fieldsSize);
5855
for (int i = 0; i < fieldsSize; i++) {
5956
fields[i].encode(stream);
@@ -74,9 +71,6 @@ public static SCSpecUDTStructV0 decode(XdrDataInputStream stream, int maxDepth)
7471
if (fieldsSize < 0) {
7572
throw new IOException("fields size " + fieldsSize + " is negative");
7673
}
77-
if (fieldsSize > 40) {
78-
throw new IOException("fields size " + fieldsSize + " exceeds max size 40");
79-
}
8074
int fieldsRemainingInputLen = stream.getRemainingInputLen();
8175
if (fieldsRemainingInputLen >= 0 && fieldsRemainingInputLen < fieldsSize) {
8276
throw new IOException(

src/main/java/org/stellar/sdk/xdr/SCSpecUDTUnionCaseTupleV0.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* {
2020
* string doc&lt;SC_SPEC_DOC_LIMIT&gt;;
2121
* string name&lt;60&gt;;
22-
* SCSpecTypeDef type&lt;12&gt;;
22+
* SCSpecTypeDef type&lt;&gt;;
2323
* };
2424
* </pre>
2525
*/
@@ -44,9 +44,6 @@ public void encode(XdrDataOutputStream stream) throws IOException {
4444
}
4545
name.encode(stream);
4646
int typeSize = getType().length;
47-
if (typeSize > 12) {
48-
throw new IOException("type size " + typeSize + " exceeds max size 12");
49-
}
5047
stream.writeInt(typeSize);
5148
for (int i = 0; i < typeSize; i++) {
5249
type[i].encode(stream);
@@ -67,9 +64,6 @@ public static SCSpecUDTUnionCaseTupleV0 decode(XdrDataInputStream stream, int ma
6764
if (typeSize < 0) {
6865
throw new IOException("type size " + typeSize + " is negative");
6966
}
70-
if (typeSize > 12) {
71-
throw new IOException("type size " + typeSize + " exceeds max size 12");
72-
}
7367
int typeRemainingInputLen = stream.getRemainingInputLen();
7468
if (typeRemainingInputLen >= 0 && typeRemainingInputLen < typeSize) {
7569
throw new IOException(

src/main/java/org/stellar/sdk/xdr/SCSpecUDTUnionV0.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* string doc&lt;SC_SPEC_DOC_LIMIT&gt;;
2121
* string lib&lt;80&gt;;
2222
* string name&lt;60&gt;;
23-
* SCSpecUDTUnionCaseV0 cases&lt;50&gt;;
23+
* SCSpecUDTUnionCaseV0 cases&lt;&gt;;
2424
* };
2525
* </pre>
2626
*/
@@ -51,9 +51,6 @@ public void encode(XdrDataOutputStream stream) throws IOException {
5151
}
5252
name.encode(stream);
5353
int casesSize = getCases().length;
54-
if (casesSize > 50) {
55-
throw new IOException("cases size " + casesSize + " exceeds max size 50");
56-
}
5754
stream.writeInt(casesSize);
5855
for (int i = 0; i < casesSize; i++) {
5956
cases[i].encode(stream);
@@ -74,9 +71,6 @@ public static SCSpecUDTUnionV0 decode(XdrDataInputStream stream, int maxDepth)
7471
if (casesSize < 0) {
7572
throw new IOException("cases size " + casesSize + " is negative");
7673
}
77-
if (casesSize > 50) {
78-
throw new IOException("cases size " + casesSize + " exceeds max size 50");
79-
}
8074
int casesRemainingInputLen = stream.getRemainingInputLen();
8175
if (casesRemainingInputLen >= 0 && casesRemainingInputLen < casesSize) {
8276
throw new IOException(

0 commit comments

Comments
 (0)