@arcium-hq/client 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.mjs CHANGED
@@ -2,7 +2,7 @@ import { randomBytes, createHash, hkdfSync, createCipheriv, createDecipheriv } f
2
2
  import { ed25519 } from '@noble/curves/ed25519';
3
3
  export { x25519 } from '@noble/curves/ed25519';
4
4
  import { shake256, sha3_512 } from '@noble/hashes/sha3';
5
- import { invert } from '@noble/curves/abstract/modular';
5
+ import { invert, mod, isNegativeLE, pow2 } from '@noble/curves/abstract/modular';
6
6
  import * as anchor from '@coral-xyz/anchor';
7
7
  import { Program, EventManager } from '@coral-xyz/anchor';
8
8
  import { randomBytes as randomBytes$1 } from '@noble/hashes/utils';
@@ -1060,7 +1060,7 @@ function getCounter(nonce, nBlocks) {
1060
1060
  // SHA3-512 instead of SHA-512 since its multiplicative depth is much lower, which
1061
1061
  // makes it much better suited to be evaluated in MPC.
1062
1062
  // Those are the parameters specified [here](https://datatracker.ietf.org/doc/html/rfc8032#section-5.1)
1063
- // (except for the hash function, see above). The below is copied from [here](https://github.com/paulmillr/noble-curves/blob/main/src/ed25519.ts#L111).
1063
+ // (except for the hash function, see above). The below is copied from [here](https://github.com/paulmillr/noble-curves/blob/main/src/ed25519.ts).
1064
1064
  const arcisEd25519Defaults = (() => ({
1065
1065
  a: BigInt('57896044618658097711785492504343953926634992332820282019728792003956564819948'),
1066
1066
  d: BigInt('37095705934669439343138083508754565189542113879843219016388785533085940283555'),
@@ -1074,6 +1074,34 @@ const arcisEd25519Defaults = (() => ({
1074
1074
  adjustScalarBytes,
1075
1075
  uvRatio,
1076
1076
  }))();
1077
+ /**
1078
+ * Ed25519 curve instance using SHA3-512 for hashing, suitable for MPC (ArcisEd25519 signature scheme).
1079
+ * This is essentially Ed25519 but with SHA3-512 instead of SHA-512 for lower multiplicative depth.
1080
+ * See: https://datatracker.ietf.org/doc/html/rfc8032#section-5.1
1081
+ */
1082
+ const arcisEd25519 = (() => twistedEdwards(arcisEd25519Defaults))();
1083
+ // Helper function for the sqrt in Fp.
1084
+ function ed25519_pow_2_252_3(x) {
1085
+ // prettier-ignore
1086
+ const _10n = BigInt(10), _20n = BigInt(20), _40n = BigInt(40), _80n = BigInt(80);
1087
+ const P = ed25519.CURVE.Fp.ORDER;
1088
+ const x2 = (x * x) % P;
1089
+ const b2 = (x2 * x) % P; // x^3, 11
1090
+ const b4 = (pow2(b2, 2n, P) * b2) % P; // x^15, 1111
1091
+ const b5 = (pow2(b4, 1n, P) * x) % P; // x^31
1092
+ const b10 = (pow2(b5, 5n, P) * b5) % P;
1093
+ const b20 = (pow2(b10, _10n, P) * b10) % P;
1094
+ const b40 = (pow2(b20, _20n, P) * b20) % P;
1095
+ const b80 = (pow2(b40, _40n, P) * b40) % P;
1096
+ const b160 = (pow2(b80, _80n, P) * b80) % P;
1097
+ const b240 = (pow2(b160, _80n, P) * b80) % P;
1098
+ const b250 = (pow2(b240, _10n, P) * b10) % P;
1099
+ const pow_p_5_8 = (pow2(b250, 2n, P) * x) % P;
1100
+ // ^ To pow to (p+3)/8, multiply it by x.
1101
+ return { pow_p_5_8, b2 };
1102
+ }
1103
+ // Fp.sqrt(Fp.neg(1))
1104
+ const ED25519_SQRT_M1 = /* @__PURE__ */ BigInt('19681161376707505956807079304988542015446066515923890162744021073123829784752');
1077
1105
  /**
1078
1106
  * Clamps a 32-byte scalar as required by the Ed25519 signature scheme.
1079
1107
  * See: https://datatracker.ietf.org/doc/html/rfc8032#section-5.1.5
@@ -1088,19 +1116,30 @@ function adjustScalarBytes(bytes) {
1088
1116
  return clamped;
1089
1117
  }
1090
1118
  /**
1091
- * Dummy function for compatibility; not used in the ArcisEd25519 signature scheme.
1092
- * Always returns { isValid: true, value: 0n }.
1093
- * @returns An object with isValid: true and value: 0n.
1119
+ * Helper function for decompression, calculating √(u/v).
1120
+ * @returns An object with isValid and value.
1094
1121
  */
1095
- function uvRatio() {
1096
- return { isValid: true, value: 0n };
1122
+ function uvRatio(u, v) {
1123
+ const P = ed25519.CURVE.Fp.ORDER;
1124
+ const v3 = mod(v * v * v, P); // v³
1125
+ const v7 = mod(v3 * v3 * v, P); // v⁷
1126
+ // (p+3)/8 and (p-5)/8
1127
+ const pow = ed25519_pow_2_252_3(u * v7).pow_p_5_8;
1128
+ let x = mod(u * v3 * pow, P); // (uv³)(uv⁷)^(p-5)/8
1129
+ const vx2 = mod(v * x * x, P); // vx²
1130
+ const root1 = x; // First root candidate
1131
+ const root2 = mod(x * ED25519_SQRT_M1, P); // Second root candidate
1132
+ const useRoot1 = vx2 === u; // If vx² = u (mod p), x is a square root
1133
+ const useRoot2 = vx2 === mod(-u, P); // If vx² = -u, set x <-- x * 2^((p-1)/4)
1134
+ const noRoot = vx2 === mod(-u * ED25519_SQRT_M1, P); // There is no valid root, vx² = -u√(-1)
1135
+ if (useRoot1)
1136
+ x = root1;
1137
+ if (useRoot2 || noRoot)
1138
+ x = root2; // We return root2 anyway, for const-time
1139
+ if (isNegativeLE(x, P))
1140
+ x = mod(-x, P);
1141
+ return { isValid: useRoot1 || useRoot2, value: x };
1097
1142
  }
1098
- /**
1099
- * Ed25519 curve instance using SHA3-512 for hashing, suitable for MPC (ArcisEd25519 signature scheme).
1100
- * This is essentially Ed25519 but with SHA3-512 instead of SHA-512 for lower multiplicative depth.
1101
- * See: https://datatracker.ietf.org/doc/html/rfc8032#section-5.1
1102
- */
1103
- const arcisEd25519 = (() => twistedEdwards(arcisEd25519Defaults))();
1104
1143
 
1105
1144
  /**
1106
1145
  * AES-128 cipher in Counter (CTR) mode, using HKDF-SHA3-256 to derive the key from a shared secret.
@@ -1249,10 +1288,10 @@ class Aes256Cipher {
1249
1288
  }
1250
1289
  }
1251
1290
 
1252
- var address = "BKck65TgoKRokMjQM3datB9oRwJ8rAj2jxPXvHXUvcL6";
1291
+ var address = "Bv3Fb9VjzjWGfX18QTUcVycAfeLoQ5zZN6vv2g3cTZxp";
1253
1292
  var metadata = {
1254
1293
  name: "arcium",
1255
- version: "0.2.0",
1294
+ version: "0.4.0",
1256
1295
  spec: "0.1.0",
1257
1296
  description: "The Arcium program"
1258
1297
  };
@@ -1570,7 +1609,7 @@ var instructions = [
1570
1609
  },
1571
1610
  {
1572
1611
  kind: "account",
1573
- path: "mxe.cluster.ok_or(MXEError :: ClusterNotSet) ? ",
1612
+ path: "mxe.cluster.ok_or(ArciumError :: ClusterNotSet) ? ",
1574
1613
  account: "MXEAccount"
1575
1614
  }
1576
1615
  ]
@@ -1745,20 +1784,24 @@ var instructions = [
1745
1784
  name: "ExecutionStatus"
1746
1785
  }
1747
1786
  }
1787
+ },
1788
+ {
1789
+ name: "callback_transaction_index",
1790
+ type: "u8"
1748
1791
  }
1749
1792
  ]
1750
1793
  },
1751
1794
  {
1752
- name: "deactivate_arx",
1795
+ name: "claim_failure_append",
1753
1796
  discriminator: [
1754
- 117,
1755
- 244,
1756
- 137,
1757
- 148,
1758
- 25,
1759
- 190,
1760
- 175,
1761
- 164
1797
+ 92,
1798
+ 52,
1799
+ 184,
1800
+ 203,
1801
+ 76,
1802
+ 221,
1803
+ 128,
1804
+ 69
1762
1805
  ],
1763
1806
  accounts: [
1764
1807
  {
@@ -1767,156 +1810,233 @@ var instructions = [
1767
1810
  signer: true
1768
1811
  },
1769
1812
  {
1770
- name: "arx_node_acc",
1813
+ name: "failure_acc",
1771
1814
  writable: true,
1772
1815
  pda: {
1773
1816
  seeds: [
1774
1817
  {
1775
1818
  kind: "const",
1776
1819
  value: [
1777
- 65,
1820
+ 70,
1821
+ 97,
1822
+ 105,
1823
+ 108,
1824
+ 117,
1778
1825
  114,
1779
- 120,
1780
- 78,
1826
+ 101,
1827
+ 67,
1828
+ 108,
1829
+ 97,
1830
+ 105,
1831
+ 109,
1832
+ 65,
1833
+ 99,
1834
+ 99,
1781
1835
  111,
1836
+ 117,
1837
+ 110,
1838
+ 116,
1839
+ 72,
1840
+ 101,
1841
+ 97,
1782
1842
  100,
1783
- 101
1843
+ 101,
1844
+ 114
1784
1845
  ]
1785
1846
  },
1786
1847
  {
1787
1848
  kind: "arg",
1788
- path: "_node_offset"
1849
+ path: "mxe_program"
1850
+ },
1851
+ {
1852
+ kind: "arg",
1853
+ path: "comp_offset"
1789
1854
  }
1790
1855
  ]
1791
1856
  }
1792
1857
  },
1793
1858
  {
1794
- name: "clock",
1859
+ name: "system_program",
1860
+ address: "11111111111111111111111111111111"
1861
+ }
1862
+ ],
1863
+ args: [
1864
+ {
1865
+ name: "comp_offset",
1866
+ type: "u64"
1867
+ },
1868
+ {
1869
+ name: "node_offset",
1870
+ type: "u32"
1871
+ },
1872
+ {
1873
+ name: "mxe_program",
1874
+ type: "pubkey"
1875
+ },
1876
+ {
1877
+ name: "chunk",
1878
+ type: "bytes"
1879
+ },
1880
+ {
1881
+ name: "failure_claim_offset",
1882
+ type: "u32"
1883
+ }
1884
+ ]
1885
+ },
1886
+ {
1887
+ name: "claim_failure_finalize",
1888
+ discriminator: [
1889
+ 192,
1890
+ 133,
1891
+ 215,
1892
+ 19,
1893
+ 76,
1894
+ 107,
1895
+ 111,
1896
+ 217
1897
+ ],
1898
+ accounts: [
1899
+ {
1900
+ name: "signer",
1901
+ signer: true
1902
+ },
1903
+ {
1904
+ name: "failure_acc",
1905
+ writable: true,
1795
1906
  pda: {
1796
1907
  seeds: [
1797
1908
  {
1798
1909
  kind: "const",
1799
1910
  value: [
1911
+ 70,
1912
+ 97,
1913
+ 105,
1914
+ 108,
1915
+ 117,
1916
+ 114,
1917
+ 101,
1800
1918
  67,
1801
1919
  108,
1802
- 111,
1803
- 99,
1804
- 107,
1920
+ 97,
1921
+ 105,
1922
+ 109,
1805
1923
  65,
1806
1924
  99,
1807
1925
  99,
1808
1926
  111,
1809
1927
  117,
1810
1928
  110,
1811
- 116
1812
- ]
1813
- }
1814
- ]
1815
- }
1816
- },
1817
- {
1818
- name: "cluster_acc_0",
1819
- optional: true,
1820
- pda: {
1821
- seeds: [
1822
- {
1823
- kind: "const",
1824
- value: [
1825
- 67,
1826
- 108,
1827
- 117,
1828
- 115,
1829
1929
  116,
1930
+ 72,
1931
+ 101,
1932
+ 97,
1933
+ 100,
1830
1934
  101,
1831
1935
  114
1832
1936
  ]
1833
1937
  },
1834
1938
  {
1835
- kind: "account",
1836
- path: "arx_node_acc.cluster_memberships",
1837
- account: "ArxNode"
1939
+ kind: "arg",
1940
+ path: "_mxe_program"
1941
+ },
1942
+ {
1943
+ kind: "arg",
1944
+ path: "comp_offset"
1838
1945
  }
1839
1946
  ]
1840
1947
  }
1841
1948
  },
1842
1949
  {
1843
- name: "cluster_acc_1",
1844
- optional: true,
1950
+ name: "executing_pool",
1951
+ writable: true,
1845
1952
  pda: {
1846
1953
  seeds: [
1847
1954
  {
1848
1955
  kind: "const",
1849
1956
  value: [
1850
- 67,
1851
- 108,
1852
- 117,
1853
- 115,
1854
- 116,
1957
+ 69,
1958
+ 120,
1855
1959
  101,
1856
- 114
1960
+ 99,
1961
+ 112,
1962
+ 111,
1963
+ 111,
1964
+ 108
1857
1965
  ]
1858
1966
  },
1859
1967
  {
1860
- kind: "account",
1861
- path: "arx_node_acc.cluster_memberships.get(1).ok_or(NodeError ::\nInvalidClusterMembership) ? ",
1862
- account: "ArxNode"
1968
+ kind: "arg",
1969
+ path: "_mxe_program"
1863
1970
  }
1864
1971
  ]
1865
1972
  }
1866
1973
  },
1867
1974
  {
1868
- name: "cluster_acc_2",
1869
- optional: true,
1975
+ name: "mempool",
1976
+ writable: true,
1870
1977
  pda: {
1871
1978
  seeds: [
1872
1979
  {
1873
1980
  kind: "const",
1874
1981
  value: [
1875
- 67,
1876
- 108,
1877
- 117,
1878
- 115,
1879
- 116,
1982
+ 77,
1880
1983
  101,
1881
- 114
1984
+ 109,
1985
+ 112,
1986
+ 111,
1987
+ 111,
1988
+ 108
1882
1989
  ]
1883
1990
  },
1884
1991
  {
1885
- kind: "account",
1886
- path: "arx_node_acc.cluster_memberships.get(2).ok_or(NodeError ::\nInvalidClusterMembership) ? ",
1887
- account: "ArxNode"
1992
+ kind: "arg",
1993
+ path: "_mxe_program"
1888
1994
  }
1889
1995
  ]
1890
1996
  }
1891
1997
  },
1892
1998
  {
1893
- name: "cluster_acc_3",
1894
- optional: true,
1999
+ name: "comp",
2000
+ writable: true,
1895
2001
  pda: {
1896
2002
  seeds: [
1897
2003
  {
1898
2004
  kind: "const",
1899
2005
  value: [
1900
2006
  67,
1901
- 108,
2007
+ 111,
2008
+ 109,
2009
+ 112,
1902
2010
  117,
1903
- 115,
1904
2011
  116,
1905
- 101,
1906
- 114
2012
+ 97,
2013
+ 116,
2014
+ 105,
2015
+ 111,
2016
+ 110,
2017
+ 65,
2018
+ 99,
2019
+ 99,
2020
+ 111,
2021
+ 117,
2022
+ 110,
2023
+ 116
1907
2024
  ]
1908
2025
  },
1909
2026
  {
1910
- kind: "account",
1911
- path: "arx_node_acc.cluster_memberships.get(3).ok_or(NodeError ::\nInvalidClusterMembership) ? ",
1912
- account: "ArxNode"
2027
+ kind: "arg",
2028
+ path: "_mxe_program"
2029
+ },
2030
+ {
2031
+ kind: "arg",
2032
+ path: "comp_offset"
1913
2033
  }
1914
2034
  ]
1915
2035
  }
1916
2036
  },
1917
2037
  {
1918
- name: "cluster_acc_4",
1919
- optional: true,
2038
+ name: "cluster_acc",
2039
+ writable: true,
1920
2040
  pda: {
1921
2041
  seeds: [
1922
2042
  {
@@ -1933,41 +2053,125 @@ var instructions = [
1933
2053
  },
1934
2054
  {
1935
2055
  kind: "account",
1936
- path: "arx_node_acc.cluster_memberships.get(4).ok_or(NodeError ::\nInvalidClusterMembership) ? ",
1937
- account: "ArxNode"
2056
+ path: "mxe.cluster.ok_or(ArciumError :: ClusterNotSet) ? ",
2057
+ account: "MXEAccount"
1938
2058
  }
1939
2059
  ]
1940
2060
  }
1941
2061
  },
1942
2062
  {
1943
- name: "cluster_acc_5",
1944
- optional: true,
2063
+ name: "mxe",
1945
2064
  pda: {
1946
2065
  seeds: [
1947
2066
  {
1948
2067
  kind: "const",
1949
2068
  value: [
1950
- 67,
1951
- 108,
2069
+ 77,
2070
+ 88,
2071
+ 69,
2072
+ 65,
2073
+ 99,
2074
+ 99,
2075
+ 111,
1952
2076
  117,
1953
- 115,
1954
- 116,
1955
- 101,
1956
- 114
2077
+ 110,
2078
+ 116
1957
2079
  ]
1958
2080
  },
1959
2081
  {
1960
- kind: "account",
1961
- path: "arx_node_acc.cluster_memberships.get(5).ok_or(NodeError ::\nInvalidClusterMembership) ? ",
1962
- account: "ArxNode"
2082
+ kind: "arg",
2083
+ path: "_mxe_program"
1963
2084
  }
1964
2085
  ]
1965
2086
  }
2087
+ }
2088
+ ],
2089
+ args: [
2090
+ {
2091
+ name: "comp_offset",
2092
+ type: "u64"
1966
2093
  },
1967
2094
  {
1968
- name: "cluster_acc_6",
1969
- optional: true,
1970
- pda: {
2095
+ name: "node_offset",
2096
+ type: "u32"
2097
+ },
2098
+ {
2099
+ name: "mxe_program",
2100
+ type: "pubkey"
2101
+ }
2102
+ ]
2103
+ },
2104
+ {
2105
+ name: "claim_failure_init",
2106
+ discriminator: [
2107
+ 204,
2108
+ 106,
2109
+ 245,
2110
+ 73,
2111
+ 212,
2112
+ 136,
2113
+ 61,
2114
+ 99
2115
+ ],
2116
+ accounts: [
2117
+ {
2118
+ name: "signer",
2119
+ writable: true,
2120
+ signer: true
2121
+ },
2122
+ {
2123
+ name: "node_acc",
2124
+ pda: {
2125
+ seeds: [
2126
+ {
2127
+ kind: "const",
2128
+ value: [
2129
+ 65,
2130
+ 114,
2131
+ 120,
2132
+ 78,
2133
+ 111,
2134
+ 100,
2135
+ 101
2136
+ ]
2137
+ },
2138
+ {
2139
+ kind: "arg",
2140
+ path: "node_offset"
2141
+ }
2142
+ ]
2143
+ }
2144
+ },
2145
+ {
2146
+ name: "mxe",
2147
+ pda: {
2148
+ seeds: [
2149
+ {
2150
+ kind: "const",
2151
+ value: [
2152
+ 77,
2153
+ 88,
2154
+ 69,
2155
+ 65,
2156
+ 99,
2157
+ 99,
2158
+ 111,
2159
+ 117,
2160
+ 110,
2161
+ 116
2162
+ ]
2163
+ },
2164
+ {
2165
+ kind: "arg",
2166
+ path: "_mxe_program"
2167
+ }
2168
+ ]
2169
+ }
2170
+ },
2171
+ {
2172
+ name: "cluster_acc",
2173
+ writable: true,
2174
+ pda: {
1971
2175
  seeds: [
1972
2176
  {
1973
2177
  kind: "const",
@@ -1983,133 +2187,203 @@ var instructions = [
1983
2187
  },
1984
2188
  {
1985
2189
  kind: "account",
1986
- path: "arx_node_acc.cluster_memberships.get(6).ok_or(NodeError ::\nInvalidClusterMembership) ? ",
1987
- account: "ArxNode"
2190
+ path: "mxe.cluster.ok_or(ArciumError :: ClusterNotSet) ? ",
2191
+ account: "MXEAccount"
1988
2192
  }
1989
2193
  ]
1990
2194
  }
1991
2195
  },
1992
2196
  {
1993
- name: "cluster_acc_7",
1994
- optional: true,
2197
+ name: "comp_acc",
1995
2198
  pda: {
1996
2199
  seeds: [
1997
2200
  {
1998
2201
  kind: "const",
1999
2202
  value: [
2000
2203
  67,
2001
- 108,
2204
+ 111,
2205
+ 109,
2206
+ 112,
2002
2207
  117,
2003
- 115,
2004
2208
  116,
2005
- 101,
2006
- 114
2209
+ 97,
2210
+ 116,
2211
+ 105,
2212
+ 111,
2213
+ 110,
2214
+ 65,
2215
+ 99,
2216
+ 99,
2217
+ 111,
2218
+ 117,
2219
+ 110,
2220
+ 116
2007
2221
  ]
2008
2222
  },
2009
2223
  {
2010
- kind: "account",
2011
- path: "arx_node_acc.cluster_memberships.get(7).ok_or(NodeError ::\nInvalidClusterMembership) ? ",
2012
- account: "ArxNode"
2224
+ kind: "arg",
2225
+ path: "_mxe_program"
2226
+ },
2227
+ {
2228
+ kind: "arg",
2229
+ path: "comp_offset"
2013
2230
  }
2014
2231
  ]
2015
2232
  }
2016
2233
  },
2017
2234
  {
2018
- name: "cluster_acc_8",
2019
- optional: true,
2235
+ name: "comp_def_acc",
2020
2236
  pda: {
2021
2237
  seeds: [
2022
2238
  {
2023
2239
  kind: "const",
2024
2240
  value: [
2025
2241
  67,
2026
- 108,
2242
+ 111,
2243
+ 109,
2244
+ 112,
2027
2245
  117,
2028
- 115,
2029
2246
  116,
2247
+ 97,
2248
+ 116,
2249
+ 105,
2250
+ 111,
2251
+ 110,
2252
+ 68,
2030
2253
  101,
2031
- 114
2254
+ 102,
2255
+ 105,
2256
+ 110,
2257
+ 105,
2258
+ 116,
2259
+ 105,
2260
+ 111,
2261
+ 110,
2262
+ 65,
2263
+ 99,
2264
+ 99,
2265
+ 111,
2266
+ 117,
2267
+ 110,
2268
+ 116
2032
2269
  ]
2033
2270
  },
2271
+ {
2272
+ kind: "arg",
2273
+ path: "_mxe_program"
2274
+ },
2034
2275
  {
2035
2276
  kind: "account",
2036
- path: "arx_node_acc.cluster_memberships.get(8).ok_or(NodeError ::\nInvalidClusterMembership) ? ",
2037
- account: "ArxNode"
2277
+ path: "comp_acc.computation_definition_offset",
2278
+ account: "ComputationAccount"
2038
2279
  }
2039
2280
  ]
2040
2281
  }
2041
2282
  },
2042
2283
  {
2043
- name: "cluster_acc_9",
2044
- optional: true,
2284
+ name: "failure_acc",
2285
+ writable: true,
2045
2286
  pda: {
2046
2287
  seeds: [
2047
2288
  {
2048
2289
  kind: "const",
2049
2290
  value: [
2291
+ 70,
2292
+ 97,
2293
+ 105,
2294
+ 108,
2295
+ 117,
2296
+ 114,
2297
+ 101,
2050
2298
  67,
2051
2299
  108,
2300
+ 97,
2301
+ 105,
2302
+ 109,
2303
+ 65,
2304
+ 99,
2305
+ 99,
2306
+ 111,
2052
2307
  117,
2053
- 115,
2308
+ 110,
2054
2309
  116,
2310
+ 72,
2311
+ 101,
2312
+ 97,
2313
+ 100,
2055
2314
  101,
2056
2315
  114
2057
2316
  ]
2058
2317
  },
2059
2318
  {
2060
- kind: "account",
2061
- path: "arx_node_acc.cluster_memberships.get(9).ok_or(NodeError ::\nInvalidClusterMembership) ? ",
2062
- account: "ArxNode"
2319
+ kind: "arg",
2320
+ path: "_mxe_program"
2321
+ },
2322
+ {
2323
+ kind: "arg",
2324
+ path: "comp_offset"
2063
2325
  }
2064
2326
  ]
2065
2327
  }
2328
+ },
2329
+ {
2330
+ name: "system_program",
2331
+ address: "11111111111111111111111111111111"
2066
2332
  }
2067
2333
  ],
2068
2334
  args: [
2335
+ {
2336
+ name: "comp_offset",
2337
+ type: "u64"
2338
+ },
2069
2339
  {
2070
2340
  name: "node_offset",
2071
2341
  type: "u32"
2342
+ },
2343
+ {
2344
+ name: "mxe_program",
2345
+ type: "pubkey"
2072
2346
  }
2073
2347
  ]
2074
2348
  },
2075
2349
  {
2076
- name: "deactivate_cluster",
2350
+ name: "deactivate_arx",
2077
2351
  discriminator: [
2078
- 13,
2079
- 42,
2080
- 182,
2081
- 159,
2082
- 184,
2083
- 10,
2084
- 212,
2085
- 178
2352
+ 117,
2353
+ 244,
2354
+ 137,
2355
+ 148,
2356
+ 25,
2357
+ 190,
2358
+ 175,
2359
+ 164
2086
2360
  ],
2087
2361
  accounts: [
2088
2362
  {
2089
- name: "authority",
2363
+ name: "signer",
2090
2364
  writable: true,
2091
2365
  signer: true
2092
2366
  },
2093
2367
  {
2094
- name: "cluster_acc",
2368
+ name: "arx_node_acc",
2095
2369
  writable: true,
2096
2370
  pda: {
2097
2371
  seeds: [
2098
2372
  {
2099
2373
  kind: "const",
2100
2374
  value: [
2101
- 67,
2102
- 108,
2103
- 117,
2104
- 115,
2105
- 116,
2106
- 101,
2107
- 114
2375
+ 65,
2376
+ 114,
2377
+ 120,
2378
+ 78,
2379
+ 111,
2380
+ 100,
2381
+ 101
2108
2382
  ]
2109
2383
  },
2110
2384
  {
2111
2385
  kind: "arg",
2112
- path: "_id"
2386
+ path: "_node_offset"
2113
2387
  }
2114
2388
  ]
2115
2389
  }
@@ -2139,287 +2413,233 @@ var instructions = [
2139
2413
  }
2140
2414
  },
2141
2415
  {
2142
- name: "system_program",
2143
- address: "11111111111111111111111111111111"
2144
- }
2145
- ],
2146
- args: [
2147
- {
2148
- name: "cluster_id",
2149
- type: "u32"
2416
+ name: "cluster_acc_0",
2417
+ optional: true,
2418
+ pda: {
2419
+ seeds: [
2420
+ {
2421
+ kind: "const",
2422
+ value: [
2423
+ 67,
2424
+ 108,
2425
+ 117,
2426
+ 115,
2427
+ 116,
2428
+ 101,
2429
+ 114
2430
+ ]
2431
+ },
2432
+ {
2433
+ kind: "account",
2434
+ path: "arx_node_acc.cluster_memberships",
2435
+ account: "ArxNode"
2436
+ }
2437
+ ]
2438
+ }
2150
2439
  },
2151
2440
  {
2152
- name: "deactivation_epoch",
2153
- type: {
2154
- defined: {
2155
- name: "Epoch"
2156
- }
2441
+ name: "cluster_acc_1",
2442
+ optional: true,
2443
+ pda: {
2444
+ seeds: [
2445
+ {
2446
+ kind: "const",
2447
+ value: [
2448
+ 67,
2449
+ 108,
2450
+ 117,
2451
+ 115,
2452
+ 116,
2453
+ 101,
2454
+ 114
2455
+ ]
2456
+ },
2457
+ {
2458
+ kind: "account",
2459
+ path: "arx_node_acc.cluster_memberships.get(1).ok_or(ArciumError ::\nInvalidClusterMembership) ? ",
2460
+ account: "ArxNode"
2461
+ }
2462
+ ]
2157
2463
  }
2158
- }
2159
- ]
2160
- },
2161
- {
2162
- name: "dummy_instruction",
2163
- docs: [
2164
- "Only present so the mempool and execpool accounts are actually included in the idl, since we",
2165
- "don't explicitly declare them in the accounts section of the other instructions."
2166
- ],
2167
- discriminator: [
2168
- 57,
2169
- 4,
2170
- 200,
2171
- 151,
2172
- 58,
2173
- 19,
2174
- 120,
2175
- 9
2176
- ],
2177
- accounts: [
2178
- {
2179
- name: "tiny_mempool"
2180
2464
  },
2181
2465
  {
2182
- name: "tiny_execpool"
2183
- },
2184
- {
2185
- name: "small_mempool"
2186
- },
2187
- {
2188
- name: "small_execpool"
2189
- },
2190
- {
2191
- name: "medium_mempool"
2192
- },
2193
- {
2194
- name: "medium_execpool"
2195
- },
2196
- {
2197
- name: "large_mempool"
2198
- },
2199
- {
2200
- name: "large_execpool"
2201
- }
2202
- ],
2203
- args: [
2204
- ]
2205
- },
2206
- {
2207
- name: "embiggen_raw_circuit_acc",
2208
- discriminator: [
2209
- 92,
2210
- 195,
2211
- 192,
2212
- 21,
2213
- 193,
2214
- 242,
2215
- 135,
2216
- 194
2217
- ],
2218
- accounts: [
2219
- {
2220
- name: "signer",
2221
- writable: true,
2222
- signer: true
2223
- },
2224
- {
2225
- name: "comp_def_acc",
2466
+ name: "cluster_acc_2",
2467
+ optional: true,
2226
2468
  pda: {
2227
2469
  seeds: [
2228
2470
  {
2229
2471
  kind: "const",
2230
2472
  value: [
2231
2473
  67,
2232
- 111,
2233
- 109,
2234
- 112,
2474
+ 108,
2235
2475
  117,
2476
+ 115,
2236
2477
  116,
2237
- 97,
2238
- 116,
2239
- 105,
2240
- 111,
2241
- 110,
2242
- 68,
2243
2478
  101,
2244
- 102,
2245
- 105,
2246
- 110,
2247
- 105,
2248
- 116,
2249
- 105,
2250
- 111,
2251
- 110,
2252
- 65,
2253
- 99,
2254
- 99,
2255
- 111,
2256
- 117,
2257
- 110,
2258
- 116
2479
+ 114
2259
2480
  ]
2260
2481
  },
2261
2482
  {
2262
- kind: "arg",
2263
- path: "_mxe_program"
2264
- },
2265
- {
2266
- kind: "arg",
2267
- path: "_comp_offset"
2483
+ kind: "account",
2484
+ path: "arx_node_acc.cluster_memberships.get(2).ok_or(ArciumError ::\nInvalidClusterMembership) ? ",
2485
+ account: "ArxNode"
2268
2486
  }
2269
2487
  ]
2270
2488
  }
2271
2489
  },
2272
2490
  {
2273
- name: "comp_def_raw",
2274
- writable: true,
2491
+ name: "cluster_acc_3",
2492
+ optional: true,
2275
2493
  pda: {
2276
2494
  seeds: [
2277
2495
  {
2278
2496
  kind: "const",
2279
2497
  value: [
2280
2498
  67,
2281
- 111,
2282
- 109,
2283
- 112,
2499
+ 108,
2284
2500
  117,
2501
+ 115,
2285
2502
  116,
2286
- 97,
2287
- 116,
2288
- 105,
2289
- 111,
2290
- 110,
2291
- 68,
2292
2503
  101,
2293
- 102,
2294
- 105,
2295
- 110,
2296
- 105,
2297
- 116,
2298
- 105,
2299
- 111,
2300
- 110,
2301
- 82,
2302
- 97,
2303
- 119
2504
+ 114
2304
2505
  ]
2305
2506
  },
2306
2507
  {
2307
2508
  kind: "account",
2308
- path: "comp_def_acc"
2309
- },
2310
- {
2311
- kind: "arg",
2312
- path: "_raw_circuit_index"
2509
+ path: "arx_node_acc.cluster_memberships.get(3).ok_or(ArciumError ::\nInvalidClusterMembership) ? ",
2510
+ account: "ArxNode"
2313
2511
  }
2314
2512
  ]
2315
2513
  }
2316
2514
  },
2317
2515
  {
2318
- name: "system_program",
2319
- address: "11111111111111111111111111111111"
2320
- }
2321
- ],
2322
- args: [
2323
- {
2324
- name: "comp_offset",
2325
- type: "u32"
2326
- },
2327
- {
2328
- name: "mxe_program",
2329
- type: "pubkey"
2516
+ name: "cluster_acc_4",
2517
+ optional: true,
2518
+ pda: {
2519
+ seeds: [
2520
+ {
2521
+ kind: "const",
2522
+ value: [
2523
+ 67,
2524
+ 108,
2525
+ 117,
2526
+ 115,
2527
+ 116,
2528
+ 101,
2529
+ 114
2530
+ ]
2531
+ },
2532
+ {
2533
+ kind: "account",
2534
+ path: "arx_node_acc.cluster_memberships.get(4).ok_or(ArciumError ::\nInvalidClusterMembership) ? ",
2535
+ account: "ArxNode"
2536
+ }
2537
+ ]
2538
+ }
2330
2539
  },
2331
2540
  {
2332
- name: "raw_circuit_index",
2333
- type: "u8"
2334
- }
2335
- ]
2336
- },
2337
- {
2338
- name: "finalize_computation",
2339
- discriminator: [
2340
- 43,
2341
- 29,
2342
- 152,
2343
- 92,
2344
- 241,
2345
- 179,
2346
- 193,
2347
- 210
2348
- ],
2349
- accounts: [
2350
- {
2351
- name: "signer",
2352
- writable: true,
2353
- signer: true
2541
+ name: "cluster_acc_5",
2542
+ optional: true,
2543
+ pda: {
2544
+ seeds: [
2545
+ {
2546
+ kind: "const",
2547
+ value: [
2548
+ 67,
2549
+ 108,
2550
+ 117,
2551
+ 115,
2552
+ 116,
2553
+ 101,
2554
+ 114
2555
+ ]
2556
+ },
2557
+ {
2558
+ kind: "account",
2559
+ path: "arx_node_acc.cluster_memberships.get(5).ok_or(ArciumError ::\nInvalidClusterMembership) ? ",
2560
+ account: "ArxNode"
2561
+ }
2562
+ ]
2563
+ }
2354
2564
  },
2355
2565
  {
2356
- name: "comp",
2357
- writable: true,
2566
+ name: "cluster_acc_6",
2567
+ optional: true,
2358
2568
  pda: {
2359
2569
  seeds: [
2360
2570
  {
2361
2571
  kind: "const",
2362
2572
  value: [
2363
2573
  67,
2364
- 111,
2365
- 109,
2366
- 112,
2574
+ 108,
2367
2575
  117,
2576
+ 115,
2368
2577
  116,
2369
- 97,
2370
- 116,
2371
- 105,
2372
- 111,
2373
- 110,
2374
- 65,
2375
- 99,
2376
- 99,
2377
- 111,
2378
- 117,
2379
- 110,
2380
- 116
2578
+ 101,
2579
+ 114
2381
2580
  ]
2382
2581
  },
2383
2582
  {
2384
- kind: "arg",
2385
- path: "_mxe_program"
2583
+ kind: "account",
2584
+ path: "arx_node_acc.cluster_memberships.get(6).ok_or(ArciumError ::\nInvalidClusterMembership) ? ",
2585
+ account: "ArxNode"
2586
+ }
2587
+ ]
2588
+ }
2589
+ },
2590
+ {
2591
+ name: "cluster_acc_7",
2592
+ optional: true,
2593
+ pda: {
2594
+ seeds: [
2595
+ {
2596
+ kind: "const",
2597
+ value: [
2598
+ 67,
2599
+ 108,
2600
+ 117,
2601
+ 115,
2602
+ 116,
2603
+ 101,
2604
+ 114
2605
+ ]
2386
2606
  },
2387
2607
  {
2388
- kind: "arg",
2389
- path: "comp_offset"
2608
+ kind: "account",
2609
+ path: "arx_node_acc.cluster_memberships.get(7).ok_or(ArciumError ::\nInvalidClusterMembership) ? ",
2610
+ account: "ArxNode"
2390
2611
  }
2391
2612
  ]
2392
2613
  }
2393
2614
  },
2394
2615
  {
2395
- name: "mxe",
2616
+ name: "cluster_acc_8",
2617
+ optional: true,
2396
2618
  pda: {
2397
2619
  seeds: [
2398
2620
  {
2399
2621
  kind: "const",
2400
2622
  value: [
2401
- 77,
2402
- 88,
2403
- 69,
2404
- 65,
2405
- 99,
2406
- 99,
2407
- 111,
2623
+ 67,
2624
+ 108,
2408
2625
  117,
2409
- 110,
2410
- 116
2626
+ 115,
2627
+ 116,
2628
+ 101,
2629
+ 114
2411
2630
  ]
2412
2631
  },
2413
2632
  {
2414
- kind: "arg",
2415
- path: "_mxe_program"
2633
+ kind: "account",
2634
+ path: "arx_node_acc.cluster_memberships.get(8).ok_or(ArciumError ::\nInvalidClusterMembership) ? ",
2635
+ account: "ArxNode"
2416
2636
  }
2417
2637
  ]
2418
2638
  }
2419
2639
  },
2420
2640
  {
2421
- name: "cluster_acc",
2422
- writable: true,
2641
+ name: "cluster_acc_9",
2642
+ optional: true,
2423
2643
  pda: {
2424
2644
  seeds: [
2425
2645
  {
@@ -2436,61 +2656,169 @@ var instructions = [
2436
2656
  },
2437
2657
  {
2438
2658
  kind: "account",
2439
- path: "mxe.cluster.ok_or(MXEError :: ClusterNotSet) ? ",
2440
- account: "MXEAccount"
2659
+ path: "arx_node_acc.cluster_memberships.get(9).ok_or(ArciumError ::\nInvalidClusterMembership) ? ",
2660
+ account: "ArxNode"
2441
2661
  }
2442
2662
  ]
2443
2663
  }
2664
+ }
2665
+ ],
2666
+ args: [
2667
+ {
2668
+ name: "node_offset",
2669
+ type: "u32"
2670
+ }
2671
+ ]
2672
+ },
2673
+ {
2674
+ name: "deactivate_cluster",
2675
+ discriminator: [
2676
+ 13,
2677
+ 42,
2678
+ 182,
2679
+ 159,
2680
+ 184,
2681
+ 10,
2682
+ 212,
2683
+ 178
2684
+ ],
2685
+ accounts: [
2686
+ {
2687
+ name: "authority",
2688
+ writable: true,
2689
+ signer: true
2444
2690
  },
2445
2691
  {
2446
- name: "executing_pool",
2692
+ name: "cluster_acc",
2447
2693
  writable: true,
2448
2694
  pda: {
2449
2695
  seeds: [
2450
2696
  {
2451
2697
  kind: "const",
2452
2698
  value: [
2453
- 69,
2454
- 120,
2699
+ 67,
2700
+ 108,
2701
+ 117,
2702
+ 115,
2703
+ 116,
2455
2704
  101,
2456
- 99,
2457
- 112,
2458
- 111,
2459
- 111,
2460
- 108
2705
+ 114
2461
2706
  ]
2462
2707
  },
2463
2708
  {
2464
2709
  kind: "arg",
2465
- path: "_mxe_program"
2710
+ path: "_id"
2466
2711
  }
2467
2712
  ]
2468
2713
  }
2469
2714
  },
2470
2715
  {
2471
- name: "mempool",
2472
- writable: true,
2716
+ name: "clock",
2473
2717
  pda: {
2474
2718
  seeds: [
2475
2719
  {
2476
2720
  kind: "const",
2477
2721
  value: [
2478
- 77,
2479
- 101,
2480
- 109,
2481
- 112,
2722
+ 67,
2723
+ 108,
2482
2724
  111,
2725
+ 99,
2726
+ 107,
2727
+ 65,
2728
+ 99,
2729
+ 99,
2483
2730
  111,
2484
- 108
2731
+ 117,
2732
+ 110,
2733
+ 116
2485
2734
  ]
2486
- },
2487
- {
2488
- kind: "arg",
2489
- path: "_mxe_program"
2490
2735
  }
2491
2736
  ]
2492
2737
  }
2493
2738
  },
2739
+ {
2740
+ name: "system_program",
2741
+ address: "11111111111111111111111111111111"
2742
+ }
2743
+ ],
2744
+ args: [
2745
+ {
2746
+ name: "cluster_id",
2747
+ type: "u32"
2748
+ },
2749
+ {
2750
+ name: "deactivation_epoch",
2751
+ type: {
2752
+ defined: {
2753
+ name: "Epoch"
2754
+ }
2755
+ }
2756
+ }
2757
+ ]
2758
+ },
2759
+ {
2760
+ name: "dummy_instruction",
2761
+ docs: [
2762
+ "Only present so the mempool and execpool accounts are actually included in the idl, since we",
2763
+ "don't explicitly declare them in the accounts section of the other instructions."
2764
+ ],
2765
+ discriminator: [
2766
+ 57,
2767
+ 4,
2768
+ 200,
2769
+ 151,
2770
+ 58,
2771
+ 19,
2772
+ 120,
2773
+ 9
2774
+ ],
2775
+ accounts: [
2776
+ {
2777
+ name: "tiny_mempool"
2778
+ },
2779
+ {
2780
+ name: "tiny_execpool"
2781
+ },
2782
+ {
2783
+ name: "small_mempool"
2784
+ },
2785
+ {
2786
+ name: "small_execpool"
2787
+ },
2788
+ {
2789
+ name: "medium_mempool"
2790
+ },
2791
+ {
2792
+ name: "medium_execpool"
2793
+ },
2794
+ {
2795
+ name: "large_mempool"
2796
+ },
2797
+ {
2798
+ name: "large_execpool"
2799
+ }
2800
+ ],
2801
+ args: [
2802
+ ]
2803
+ },
2804
+ {
2805
+ name: "embiggen_raw_circuit_acc",
2806
+ discriminator: [
2807
+ 92,
2808
+ 195,
2809
+ 192,
2810
+ 21,
2811
+ 193,
2812
+ 242,
2813
+ 135,
2814
+ 194
2815
+ ],
2816
+ accounts: [
2817
+ {
2818
+ name: "signer",
2819
+ writable: true,
2820
+ signer: true
2821
+ },
2494
2822
  {
2495
2823
  name: "comp_def_acc",
2496
2824
  pda: {
@@ -2534,31 +2862,52 @@ var instructions = [
2534
2862
  },
2535
2863
  {
2536
2864
  kind: "arg",
2537
- path: "_comp_def_offset"
2865
+ path: "_comp_offset"
2538
2866
  }
2539
2867
  ]
2540
2868
  }
2541
2869
  },
2542
2870
  {
2543
- name: "clock",
2871
+ name: "comp_def_raw",
2872
+ writable: true,
2544
2873
  pda: {
2545
2874
  seeds: [
2546
2875
  {
2547
2876
  kind: "const",
2548
2877
  value: [
2549
2878
  67,
2550
- 108,
2551
- 111,
2552
- 99,
2553
- 107,
2554
- 65,
2555
- 99,
2556
- 99,
2557
2879
  111,
2880
+ 109,
2881
+ 112,
2558
2882
  117,
2883
+ 116,
2884
+ 97,
2885
+ 116,
2886
+ 105,
2887
+ 111,
2559
2888
  110,
2560
- 116
2889
+ 68,
2890
+ 101,
2891
+ 102,
2892
+ 105,
2893
+ 110,
2894
+ 105,
2895
+ 116,
2896
+ 105,
2897
+ 111,
2898
+ 110,
2899
+ 82,
2900
+ 97,
2901
+ 119
2561
2902
  ]
2903
+ },
2904
+ {
2905
+ kind: "account",
2906
+ path: "comp_def_acc"
2907
+ },
2908
+ {
2909
+ kind: "arg",
2910
+ path: "_raw_circuit_index"
2562
2911
  }
2563
2912
  ]
2564
2913
  }
@@ -2571,15 +2920,15 @@ var instructions = [
2571
2920
  args: [
2572
2921
  {
2573
2922
  name: "comp_offset",
2574
- type: "u64"
2575
- },
2576
- {
2577
- name: "comp_def_offset",
2578
2923
  type: "u32"
2579
2924
  },
2580
2925
  {
2581
2926
  name: "mxe_program",
2582
2927
  type: "pubkey"
2928
+ },
2929
+ {
2930
+ name: "raw_circuit_index",
2931
+ type: "u8"
2583
2932
  }
2584
2933
  ]
2585
2934
  },
@@ -2726,7 +3075,7 @@ var instructions = [
2726
3075
  },
2727
3076
  {
2728
3077
  kind: "account",
2729
- path: "mxe.cluster.ok_or(MXEError :: ClusterNotSet) ? ",
3078
+ path: "mxe.cluster.ok_or(ArciumError :: ClusterNotSet) ? ",
2730
3079
  account: "MXEAccount"
2731
3080
  }
2732
3081
  ]
@@ -3251,10 +3600,6 @@ var instructions = [
3251
3600
  type: {
3252
3601
  option: "pubkey"
3253
3602
  }
3254
- },
3255
- {
3256
- name: "finalize_during_callback",
3257
- type: "bool"
3258
3603
  }
3259
3604
  ]
3260
3605
  },
@@ -4078,7 +4423,7 @@ var instructions = [
4078
4423
  name: "queue_computation",
4079
4424
  docs: [
4080
4425
  "Queues a computation.",
4081
- "cu_price_micro: The priority price of a CU, in thousandths of a $ARX. Used",
4426
+ "cu_price_micro: The priority price of a CU, in thousandths of lamports. Used",
4082
4427
  "to calculate the priority fee and rounded down."
4083
4428
  ],
4084
4429
  discriminator: [
@@ -4097,6 +4442,41 @@ var instructions = [
4097
4442
  writable: true,
4098
4443
  signer: true
4099
4444
  },
4445
+ {
4446
+ name: "sign_seed",
4447
+ docs: [
4448
+ "This is ok-ish though, as we're not reading the account, we just need it to check that the",
4449
+ "CPI invocation is valid. The only downside is it's a bit ugly and wastes some CUs since",
4450
+ "we can't use a potentially stored bump."
4451
+ ],
4452
+ signer: true,
4453
+ pda: {
4454
+ seeds: [
4455
+ {
4456
+ kind: "const",
4457
+ value: [
4458
+ 83,
4459
+ 105,
4460
+ 103,
4461
+ 110,
4462
+ 101,
4463
+ 114,
4464
+ 65,
4465
+ 99,
4466
+ 99,
4467
+ 111,
4468
+ 117,
4469
+ 110,
4470
+ 116
4471
+ ]
4472
+ }
4473
+ ],
4474
+ program: {
4475
+ kind: "arg",
4476
+ path: "_mxe_program"
4477
+ }
4478
+ }
4479
+ },
4100
4480
  {
4101
4481
  name: "comp",
4102
4482
  writable: true,
@@ -4278,7 +4658,7 @@ var instructions = [
4278
4658
  },
4279
4659
  {
4280
4660
  kind: "arg",
4281
- path: "cluster_index.map_or(mxe.cluster.ok_or(MXEError :: ClusterNotSet) ? , | i |\nmxe.fallback_clusters [i as usize])"
4661
+ path: "cluster_index.map_or(mxe.cluster.ok_or(ArciumError :: ClusterNotSet) ? , | i |\nmxe.fallback_clusters [i as usize])"
4282
4662
  }
4283
4663
  ]
4284
4664
  }
@@ -4357,16 +4737,6 @@ var instructions = [
4357
4737
  }
4358
4738
  }
4359
4739
  },
4360
- {
4361
- name: "callback_accs",
4362
- type: {
4363
- vec: {
4364
- defined: {
4365
- name: "CallbackAccount"
4366
- }
4367
- }
4368
- }
4369
- },
4370
4740
  {
4371
4741
  name: "mxe_program",
4372
4742
  type: "pubkey"
@@ -4378,8 +4748,18 @@ var instructions = [
4378
4748
  }
4379
4749
  },
4380
4750
  {
4381
- name: "input_delivery_fee",
4382
- type: "u64"
4751
+ name: "custom_callback_instructions",
4752
+ type: {
4753
+ vec: {
4754
+ defined: {
4755
+ name: "CallbackInstruction"
4756
+ }
4757
+ }
4758
+ }
4759
+ },
4760
+ {
4761
+ name: "callback_transactions_required",
4762
+ type: "u8"
4383
4763
  },
4384
4764
  {
4385
4765
  name: "output_delivery_fee",
@@ -4391,6 +4771,90 @@ var instructions = [
4391
4771
  }
4392
4772
  ]
4393
4773
  },
4774
+ {
4775
+ name: "reclaim_failure_rent",
4776
+ discriminator: [
4777
+ 159,
4778
+ 99,
4779
+ 116,
4780
+ 180,
4781
+ 42,
4782
+ 9,
4783
+ 202,
4784
+ 219
4785
+ ],
4786
+ accounts: [
4787
+ {
4788
+ name: "signer",
4789
+ writable: true,
4790
+ signer: true
4791
+ },
4792
+ {
4793
+ name: "failure_acc",
4794
+ writable: true,
4795
+ pda: {
4796
+ seeds: [
4797
+ {
4798
+ kind: "const",
4799
+ value: [
4800
+ 70,
4801
+ 97,
4802
+ 105,
4803
+ 108,
4804
+ 117,
4805
+ 114,
4806
+ 101,
4807
+ 67,
4808
+ 108,
4809
+ 97,
4810
+ 105,
4811
+ 109,
4812
+ 65,
4813
+ 99,
4814
+ 99,
4815
+ 111,
4816
+ 117,
4817
+ 110,
4818
+ 116,
4819
+ 72,
4820
+ 101,
4821
+ 97,
4822
+ 100,
4823
+ 101,
4824
+ 114
4825
+ ]
4826
+ },
4827
+ {
4828
+ kind: "arg",
4829
+ path: "mxe_program"
4830
+ },
4831
+ {
4832
+ kind: "arg",
4833
+ path: "comp_offset"
4834
+ }
4835
+ ]
4836
+ }
4837
+ },
4838
+ {
4839
+ name: "clock",
4840
+ address: "SysvarC1ock11111111111111111111111111111111"
4841
+ }
4842
+ ],
4843
+ args: [
4844
+ {
4845
+ name: "comp_offset",
4846
+ type: "u64"
4847
+ },
4848
+ {
4849
+ name: "node_offset",
4850
+ type: "u32"
4851
+ },
4852
+ {
4853
+ name: "mxe_program",
4854
+ type: "pubkey"
4855
+ }
4856
+ ]
4857
+ },
4394
4858
  {
4395
4859
  name: "set_arx_node_config",
4396
4860
  discriminator: [
@@ -4754,7 +5218,7 @@ var instructions = [
4754
5218
  },
4755
5219
  {
4756
5220
  kind: "account",
4757
- path: "mxe.cluster.ok_or(MXEError :: ClusterNotSet) ? ",
5221
+ path: "mxe.cluster.ok_or(ArciumError :: ClusterNotSet) ? ",
4758
5222
  account: "MXEAccount"
4759
5223
  }
4760
5224
  ]
@@ -4782,6 +5246,33 @@ var instructions = [
4782
5246
  32
4783
5247
  ]
4784
5248
  }
5249
+ },
5250
+ {
5251
+ name: "mxe_ed25519_verifying_key",
5252
+ type: {
5253
+ array: [
5254
+ "u8",
5255
+ 32
5256
+ ]
5257
+ }
5258
+ },
5259
+ {
5260
+ name: "mxe_elgamal_pubkey",
5261
+ type: {
5262
+ array: [
5263
+ "u8",
5264
+ 32
5265
+ ]
5266
+ }
5267
+ },
5268
+ {
5269
+ name: "mxe_pubkey_validity_proof",
5270
+ type: {
5271
+ array: [
5272
+ "u8",
5273
+ 64
5274
+ ]
5275
+ }
4785
5276
  }
4786
5277
  ]
4787
5278
  },
@@ -5132,6 +5623,19 @@ var accounts = [
5132
5623
  136
5133
5624
  ]
5134
5625
  },
5626
+ {
5627
+ name: "FailureClaimAccountHeader",
5628
+ discriminator: [
5629
+ 132,
5630
+ 11,
5631
+ 106,
5632
+ 171,
5633
+ 253,
5634
+ 138,
5635
+ 56,
5636
+ 78
5637
+ ]
5638
+ },
5135
5639
  {
5136
5640
  name: "FeePool",
5137
5641
  discriminator: [
@@ -5290,6 +5794,19 @@ var events = [
5290
5794
  19
5291
5795
  ]
5292
5796
  },
5797
+ {
5798
+ name: "ClaimFailureEvent",
5799
+ discriminator: [
5800
+ 143,
5801
+ 97,
5802
+ 229,
5803
+ 166,
5804
+ 72,
5805
+ 218,
5806
+ 87,
5807
+ 145
5808
+ ]
5809
+ },
5293
5810
  {
5294
5811
  name: "FinalizeComputationEvent",
5295
5812
  discriminator: [
@@ -5303,6 +5820,19 @@ var events = [
5303
5820
  249
5304
5821
  ]
5305
5822
  },
5823
+ {
5824
+ name: "FinalizeFailureDataEvent",
5825
+ discriminator: [
5826
+ 132,
5827
+ 26,
5828
+ 138,
5829
+ 201,
5830
+ 214,
5831
+ 29,
5832
+ 244,
5833
+ 167
5834
+ ]
5835
+ },
5306
5836
  {
5307
5837
  name: "InitComputationEvent",
5308
5838
  discriminator: [
@@ -5333,48 +5863,258 @@ var events = [
5333
5863
  var errors = [
5334
5864
  {
5335
5865
  code: 6000,
5866
+ name: "InvalidAuthority",
5867
+ msg: "The given authority is invalid"
5868
+ },
5869
+ {
5870
+ code: 6001,
5871
+ name: "MxeKeysAlreadySet",
5872
+ msg: "The MXE keys are already set, i.e. all the nodes of the MXE cluster already agreed on the MXE keys"
5873
+ },
5874
+ {
5875
+ code: 6002,
5876
+ name: "MxeKeysNotSet",
5877
+ msg: "The MXE keys are not set, i.e. not all the nodes of the MXE cluster agreed on the MXE keys"
5878
+ },
5879
+ {
5880
+ code: 6003,
5881
+ name: "InvalidMXE",
5882
+ msg: "An invalid MXE account has been supplied"
5883
+ },
5884
+ {
5885
+ code: 6004,
5886
+ name: "ClusterAlreadySet",
5887
+ msg: "The cluster is already set"
5888
+ },
5889
+ {
5890
+ code: 6005,
5891
+ name: "ClusterNotSet",
5892
+ msg: "The cluster is not set"
5893
+ },
5894
+ {
5895
+ code: 6006,
5896
+ name: "InvalidCluster",
5897
+ msg: "An invalid cluster account has been supplied"
5898
+ },
5899
+ {
5900
+ code: 6007,
5901
+ name: "InvalidComputationDefinition",
5902
+ msg: "An invalid computation definition account has been supplied"
5903
+ },
5904
+ {
5905
+ code: 6008,
5906
+ name: "CantFindMempoolID",
5907
+ msg: "Couldn't find a mempool ID for the computation"
5908
+ },
5909
+ {
5910
+ code: 6100,
5911
+ name: "InvalidMempoolDiscriminator",
5912
+ msg: "Mempool discriminator is invalid"
5913
+ },
5914
+ {
5915
+ code: 6101,
5916
+ name: "InvalidMempoolSize",
5917
+ msg: "Mempool size is invalid"
5918
+ },
5919
+ {
5920
+ code: 6102,
5921
+ name: "InvalidExecpoolDiscriminator",
5922
+ msg: "Execpool discriminator is invalid"
5923
+ },
5924
+ {
5925
+ code: 6103,
5926
+ name: "MaxParallelismReached",
5927
+ msg: "Max parallelism reached"
5928
+ },
5929
+ {
5930
+ code: 6200,
5931
+ name: "InvalidComputationOffset",
5932
+ msg: "Computation offset is invalid"
5933
+ },
5934
+ {
5935
+ code: 6201,
5936
+ name: "InvalidCallbackAccs",
5937
+ msg: "Callback accounts are invalid"
5938
+ },
5939
+ {
5940
+ code: 6202,
5941
+ name: "InvalidCallbackAccsLen",
5942
+ msg: "Callback accounts length is invalid"
5943
+ },
5944
+ {
5945
+ code: 6203,
5946
+ name: "AlreadyInitializedComputation",
5947
+ msg: "The computation is already initialized"
5948
+ },
5949
+ {
5950
+ code: 6204,
5951
+ name: "AlreadyCallbackedComputation",
5952
+ msg: "Callback computation already called"
5953
+ },
5954
+ {
5955
+ code: 6205,
5956
+ name: "InvalidCallbackTx",
5957
+ msg: "Callback tx is invalid"
5958
+ },
5959
+ {
5960
+ code: 6206,
5961
+ name: "InvalidComputationStatus",
5962
+ msg: "Computation status is invalid"
5963
+ },
5964
+ {
5965
+ code: 6207,
5966
+ name: "InvalidComputation",
5967
+ msg: "Computation is invalid"
5968
+ },
5969
+ {
5970
+ code: 6208,
5971
+ name: "InvalidComputationAuthority",
5972
+ msg: "Computation authority is invalid"
5973
+ },
5974
+ {
5975
+ code: 6209,
5976
+ name: "InvalidCallbackInstructions",
5977
+ msg: "Callback instructions are invalid"
5978
+ },
5979
+ {
5980
+ code: 6300,
5981
+ name: "ComputationDefinitionNotCompleted",
5982
+ msg: "Computation definition is not completed"
5983
+ },
5984
+ {
5985
+ code: 6301,
5986
+ name: "InvalidArguments",
5987
+ msg: "Arguments supplied are invalid"
5988
+ },
5989
+ {
5990
+ code: 6302,
5991
+ name: "InvalidCircuitSource",
5992
+ msg: "Circuit source is invalid"
5993
+ },
5994
+ {
5995
+ code: 6303,
5996
+ name: "ComputationDefinitionAlreadyCompleted",
5997
+ msg: "Computation definition already completed"
5998
+ },
5999
+ {
6000
+ code: 6400,
5336
6001
  name: "InvalidNode",
5337
6002
  msg: "Node is invalid"
5338
6003
  },
5339
6004
  {
5340
- code: 6001,
6005
+ code: 6401,
5341
6006
  name: "MaxClusterMembershipReached",
5342
6007
  msg: "Maximum number of nodes in the cluster has been reached"
5343
6008
  },
5344
6009
  {
5345
- code: 6002,
6010
+ code: 6402,
5346
6011
  name: "NodeAlreadyExists",
5347
6012
  msg: "The node already exists in the cluster"
5348
6013
  },
5349
6014
  {
5350
- code: 6003,
5351
- name: "InvalidAuthority",
6015
+ code: 6403,
6016
+ name: "InvalidNodeAuthority",
5352
6017
  msg: "Node authority is invalid"
5353
6018
  },
5354
6019
  {
5355
- code: 6004,
6020
+ code: 6404,
5356
6021
  name: "NodeNotInactive",
5357
6022
  msg: "Node is not inactive"
5358
6023
  },
5359
6024
  {
5360
- code: 6005,
6025
+ code: 6405,
5361
6026
  name: "NodeNotActive",
5362
6027
  msg: "Node is not active"
5363
6028
  },
5364
6029
  {
5365
- code: 6006,
6030
+ code: 6406,
5366
6031
  name: "InvalidClusterMembership",
5367
6032
  msg: "Cluster membership is invalid"
5368
6033
  },
5369
6034
  {
5370
- code: 6007,
6035
+ code: 6407,
5371
6036
  name: "NodeInActiveCluster",
5372
6037
  msg: "Node is in an active cluster"
5373
6038
  },
5374
6039
  {
5375
- code: 6008,
5376
- name: "InvalidConfig",
6040
+ code: 6408,
6041
+ name: "InvalidNodeConfig",
5377
6042
  msg: "Node config is invalid"
6043
+ },
6044
+ {
6045
+ code: 6500,
6046
+ name: "ClusterFull",
6047
+ msg: "Cluster is full"
6048
+ },
6049
+ {
6050
+ code: 6501,
6051
+ name: "InvalidDeactivationEpoch",
6052
+ msg: "Cluster deactivation epoch is invalid"
6053
+ },
6054
+ {
6055
+ code: 6502,
6056
+ name: "InvalidMaxSize",
6057
+ msg: "Cluster maximum size is invalid"
6058
+ },
6059
+ {
6060
+ code: 6503,
6061
+ name: "InvalidClusterAuthority",
6062
+ msg: "Cluster authority is invalid"
6063
+ },
6064
+ {
6065
+ code: 6504,
6066
+ name: "InvalidFeeProposal",
6067
+ msg: "Cluster fee proposal is invalid"
6068
+ },
6069
+ {
6070
+ code: 6505,
6071
+ name: "InvalidClusterState",
6072
+ msg: "Cluster state is invalid"
6073
+ },
6074
+ {
6075
+ code: 6506,
6076
+ name: "InvalidVote",
6077
+ msg: "Cluster vote is invalid"
6078
+ },
6079
+ {
6080
+ code: 6600,
6081
+ name: "SerializationFailed",
6082
+ msg: "Borsh serialization failed"
6083
+ },
6084
+ {
6085
+ code: 6601,
6086
+ name: "DeserializationFailed",
6087
+ msg: "Borsh deserialization failed"
6088
+ },
6089
+ {
6090
+ code: 6602,
6091
+ name: "HeapFull",
6092
+ msg: "Heap is full"
6093
+ },
6094
+ {
6095
+ code: 6603,
6096
+ name: "InvalidSlot",
6097
+ msg: "Current slot is before the last updated slot"
6098
+ },
6099
+ {
6100
+ code: 6604,
6101
+ name: "EpochIsInfinity",
6102
+ msg: "Epoch is infinity"
6103
+ },
6104
+ {
6105
+ code: 6605,
6106
+ name: "InvalidTimestamp",
6107
+ msg: "Timestamp is invalid"
6108
+ },
6109
+ {
6110
+ code: 6606,
6111
+ name: "InvalidEpoch",
6112
+ msg: "Epoch is invalid"
6113
+ },
6114
+ {
6115
+ code: 6607,
6116
+ name: "EpochOverflow",
6117
+ msg: "Epoch overflowed"
5378
6118
  }
5379
6119
  ];
5380
6120
  var types = [
@@ -5419,8 +6159,17 @@ var types = [
5419
6159
  {
5420
6160
  name: "PrimitiveError"
5421
6161
  },
6162
+ {
6163
+ name: "InvalidBatchLength"
6164
+ },
5422
6165
  {
5423
6166
  name: "QuadraticNonResidue"
6167
+ },
6168
+ {
6169
+ name: "BitConversionError"
6170
+ },
6171
+ {
6172
+ name: "ChannelClosed"
5424
6173
  }
5425
6174
  ]
5426
6175
  }
@@ -5721,20 +6470,18 @@ var types = [
5721
6470
  type: "u32"
5722
6471
  },
5723
6472
  {
5724
- name: "allowed_authorities",
5725
- type: {
5726
- vec: "pubkey"
5727
- }
6473
+ name: "authority",
6474
+ docs: [
6475
+ "Admin key for node management operations"
6476
+ ],
6477
+ type: "pubkey"
5728
6478
  },
5729
6479
  {
5730
- name: "supported_protocols",
5731
- type: {
5732
- vec: {
5733
- defined: {
5734
- name: "MPCProtocol"
5735
- }
5736
- }
5737
- }
6480
+ name: "callback_authority",
6481
+ docs: [
6482
+ "Key used to sign computation callbacks - separated for operational security"
6483
+ ],
6484
+ type: "pubkey"
5738
6485
  }
5739
6486
  ]
5740
6487
  }
@@ -5775,6 +6522,35 @@ var types = [
5775
6522
  ]
5776
6523
  }
5777
6524
  },
6525
+ {
6526
+ name: "CallbackInstruction",
6527
+ docs: [
6528
+ "A custom callback instruction with its own program ID and discriminator."
6529
+ ],
6530
+ type: {
6531
+ kind: "struct",
6532
+ fields: [
6533
+ {
6534
+ name: "program_id",
6535
+ type: "pubkey"
6536
+ },
6537
+ {
6538
+ name: "discriminator",
6539
+ type: "bytes"
6540
+ },
6541
+ {
6542
+ name: "accounts",
6543
+ type: {
6544
+ vec: {
6545
+ defined: {
6546
+ name: "CallbackAccount"
6547
+ }
6548
+ }
6549
+ }
6550
+ }
6551
+ ]
6552
+ }
6553
+ },
5778
6554
  {
5779
6555
  name: "CircuitSource",
5780
6556
  type: {
@@ -5813,6 +6589,22 @@ var types = [
5813
6589
  ]
5814
6590
  }
5815
6591
  },
6592
+ {
6593
+ name: "ClaimFailureEvent",
6594
+ type: {
6595
+ kind: "struct",
6596
+ fields: [
6597
+ {
6598
+ name: "computation_offset",
6599
+ type: "u64"
6600
+ },
6601
+ {
6602
+ name: "mxe_program_id",
6603
+ type: "pubkey"
6604
+ }
6605
+ ]
6606
+ }
6607
+ },
5816
6608
  {
5817
6609
  name: "ClockAccount",
5818
6610
  docs: [
@@ -6022,20 +6814,28 @@ var types = [
6022
6814
  }
6023
6815
  },
6024
6816
  {
6025
- name: "callback_accs",
6817
+ name: "callback_url",
6818
+ type: {
6819
+ option: "string"
6820
+ }
6821
+ },
6822
+ {
6823
+ name: "custom_callback_instructions",
6026
6824
  type: {
6027
6825
  vec: {
6028
6826
  defined: {
6029
- name: "CallbackAccount"
6827
+ name: "CallbackInstruction"
6030
6828
  }
6031
6829
  }
6032
6830
  }
6033
6831
  },
6034
6832
  {
6035
- name: "callback_url",
6036
- type: {
6037
- option: "string"
6038
- }
6833
+ name: "callback_transactions_required",
6834
+ type: "u8"
6835
+ },
6836
+ {
6837
+ name: "callback_transactions_submitted_bm",
6838
+ type: "u16"
6039
6839
  },
6040
6840
  {
6041
6841
  name: "bump",
@@ -6061,13 +6861,6 @@ var types = [
6061
6861
  option: "pubkey"
6062
6862
  }
6063
6863
  },
6064
- {
6065
- name: "finalize_during_callback",
6066
- docs: [
6067
- "Whether to we need a separate callback and finalize instruction or if we can do it in one."
6068
- ],
6069
- type: "bool"
6070
- },
6071
6864
  {
6072
6865
  name: "cu_amount",
6073
6866
  docs: [
@@ -6123,15 +6916,6 @@ var types = [
6123
6916
  name: "ComputationSignature"
6124
6917
  }
6125
6918
  }
6126
- },
6127
- {
6128
- name: "callback_discriminator",
6129
- type: {
6130
- array: [
6131
- "u8",
6132
- 8
6133
- ]
6134
- }
6135
6919
  }
6136
6920
  ]
6137
6921
  }
@@ -6246,9 +7030,6 @@ var types = [
6246
7030
  {
6247
7031
  name: "Queued"
6248
7032
  },
6249
- {
6250
- name: "Executed"
6251
- },
6252
7033
  {
6253
7034
  name: "Finalized"
6254
7035
  }
@@ -6288,20 +7069,26 @@ var types = [
6288
7069
  type: "u8"
6289
7070
  },
6290
7071
  {
6291
- name: "comp_status",
7072
+ name: "padding",
6292
7073
  type: {
6293
7074
  array: [
6294
7075
  "u8",
6295
- 13
7076
+ 7
6296
7077
  ]
6297
7078
  }
6298
7079
  },
6299
7080
  {
6300
- name: "padding",
7081
+ name: "counter",
7082
+ type: "u64"
7083
+ },
7084
+ {
7085
+ name: "execpool_index",
6301
7086
  type: {
6302
7087
  array: [
6303
- "u8",
6304
- 2
7088
+ "u64",
7089
+ {
7090
+ generic: "MAX_PARRALLEL_COMPUTATIONS"
7091
+ }
6305
7092
  ]
6306
7093
  }
6307
7094
  },
@@ -6378,18 +7165,10 @@ var types = [
6378
7165
  ],
6379
7166
  type: "u64"
6380
7167
  },
6381
- {
6382
- name: "input_delivery_fee",
6383
- docs: [
6384
- "A fee for data relaying used with [super::mxe::DataProvisioning::Protected] data",
6385
- "provisioning."
6386
- ],
6387
- type: "u64"
6388
- },
6389
7168
  {
6390
7169
  name: "output_delivery_fee",
6391
7170
  docs: [
6392
- "A fee for relayer based (unverifiable) off-chain output delivery."
7171
+ "A fee for output delivery fees (i.e. tx fees)."
6393
7172
  ],
6394
7173
  type: "u64"
6395
7174
  }
@@ -6423,6 +7202,43 @@ var types = [
6423
7202
  ]
6424
7203
  }
6425
7204
  },
7205
+ {
7206
+ name: "FailureClaimAccountHeader",
7207
+ serialization: "bytemuckunsafe",
7208
+ repr: {
7209
+ kind: "c"
7210
+ },
7211
+ type: {
7212
+ kind: "struct",
7213
+ fields: [
7214
+ {
7215
+ name: "bump",
7216
+ type: "u8"
7217
+ },
7218
+ {
7219
+ name: "is_complete",
7220
+ type: "bool"
7221
+ },
7222
+ {
7223
+ name: "padding",
7224
+ type: {
7225
+ array: [
7226
+ "u8",
7227
+ 6
7228
+ ]
7229
+ }
7230
+ },
7231
+ {
7232
+ name: "challenge_end_slot",
7233
+ type: "u64"
7234
+ },
7235
+ {
7236
+ name: "poster",
7237
+ type: "pubkey"
7238
+ }
7239
+ ]
7240
+ }
7241
+ },
6426
7242
  {
6427
7243
  name: "FeePool",
6428
7244
  type: {
@@ -6451,6 +7267,22 @@ var types = [
6451
7267
  ]
6452
7268
  }
6453
7269
  },
7270
+ {
7271
+ name: "FinalizeFailureDataEvent",
7272
+ type: {
7273
+ kind: "struct",
7274
+ fields: [
7275
+ {
7276
+ name: "computation_offset",
7277
+ type: "u64"
7278
+ },
7279
+ {
7280
+ name: "mxe_program_id",
7281
+ type: "pubkey"
7282
+ }
7283
+ ]
7284
+ }
7285
+ },
6454
7286
  {
6455
7287
  name: "InitComputationEvent",
6456
7288
  type: {
@@ -6658,20 +7490,6 @@ var types = [
6658
7490
  ]
6659
7491
  }
6660
7492
  },
6661
- {
6662
- name: "MPCProtocol",
6663
- type: {
6664
- kind: "enum",
6665
- variants: [
6666
- {
6667
- name: "CERBERUS"
6668
- },
6669
- {
6670
- name: "MANTICORE"
6671
- }
6672
- ]
6673
- }
6674
- },
6675
7493
  {
6676
7494
  name: "MXEAccount",
6677
7495
  docs: [
@@ -6699,13 +7517,27 @@ var types = [
6699
7517
  }
6700
7518
  },
6701
7519
  {
6702
- name: "x25519_pubkey",
7520
+ name: "utility_pubkeys",
6703
7521
  docs: [
6704
- "The x25519 pubkey (256 bits curve25519), used for encrypted data."
7522
+ "The utility pubkeys, consisting of",
7523
+ "- x25519 pubkey (32 bytes), used for key exchange",
7524
+ "- ed25519 verifying key (32 bytes), used for signature verification",
7525
+ "- ElGamal pubkey (32 bytes), used for c-spl",
7526
+ "- ElGamal pubkey validity proof (64 bytes), used for c-spl"
6705
7527
  ],
6706
7528
  type: {
6707
7529
  defined: {
6708
- name: "X25519Pubkey"
7530
+ name: "SetUnset",
7531
+ generics: [
7532
+ {
7533
+ kind: "type",
7534
+ type: {
7535
+ defined: {
7536
+ name: "UtilityPubkeys"
7537
+ }
7538
+ }
7539
+ }
7540
+ ]
6709
7541
  }
6710
7542
  }
6711
7543
  },
@@ -7145,6 +7977,9 @@ var types = [
7145
7977
  },
7146
7978
  {
7147
7979
  name: "PlaintextFloat"
7980
+ },
7981
+ {
7982
+ name: "PlaintextPoint"
7148
7983
  }
7149
7984
  ]
7150
7985
  }
@@ -7216,6 +8051,39 @@ var types = [
7216
8051
  ]
7217
8052
  }
7218
8053
  },
8054
+ {
8055
+ name: "SetUnset",
8056
+ generics: [
8057
+ {
8058
+ kind: "type",
8059
+ name: "T"
8060
+ }
8061
+ ],
8062
+ type: {
8063
+ kind: "enum",
8064
+ variants: [
8065
+ {
8066
+ name: "Set",
8067
+ fields: [
8068
+ {
8069
+ generic: "T"
8070
+ }
8071
+ ]
8072
+ },
8073
+ {
8074
+ name: "Unset",
8075
+ fields: [
8076
+ {
8077
+ generic: "T"
8078
+ },
8079
+ {
8080
+ vec: "bool"
8081
+ }
8082
+ ]
8083
+ }
8084
+ ]
8085
+ }
8086
+ },
7219
8087
  {
7220
8088
  name: "SmallExecPool",
7221
8089
  serialization: "bytemuckunsafe",
@@ -7589,34 +8457,45 @@ var types = [
7589
8457
  }
7590
8458
  },
7591
8459
  {
7592
- name: "X25519Pubkey",
8460
+ name: "UtilityPubkeys",
7593
8461
  type: {
7594
- kind: "enum",
7595
- variants: [
8462
+ kind: "struct",
8463
+ fields: [
7596
8464
  {
7597
- name: "Set",
7598
- fields: [
7599
- {
7600
- array: [
7601
- "u8",
7602
- 32
7603
- ]
7604
- }
7605
- ]
8465
+ name: "x25519_pubkey",
8466
+ type: {
8467
+ array: [
8468
+ "u8",
8469
+ 32
8470
+ ]
8471
+ }
7606
8472
  },
7607
8473
  {
7608
- name: "Unset",
7609
- fields: [
7610
- {
7611
- array: [
7612
- "u8",
7613
- 32
7614
- ]
7615
- },
7616
- {
7617
- vec: "bool"
7618
- }
7619
- ]
8474
+ name: "ed25519_verifying_key",
8475
+ type: {
8476
+ array: [
8477
+ "u8",
8478
+ 32
8479
+ ]
8480
+ }
8481
+ },
8482
+ {
8483
+ name: "elgamal_pubkey",
8484
+ type: {
8485
+ array: [
8486
+ "u8",
8487
+ 32
8488
+ ]
8489
+ }
8490
+ },
8491
+ {
8492
+ name: "pubkey_validity_proof",
8493
+ type: {
8494
+ array: [
8495
+ "u8",
8496
+ 64
8497
+ ]
8498
+ }
7620
8499
  }
7621
8500
  ]
7622
8501
  }
@@ -7655,10 +8534,10 @@ const ARCIUM_ADDR = address;
7655
8534
  */
7656
8535
  const CLOCK_ACC_SEED = 'ClockAccount';
7657
8536
  /**
7658
- * Seed for StakingPoolAccount PDA
8537
+ * Seed for FeePool PDA
7659
8538
  * @constant {string}
7660
8539
  */
7661
- const POOL_ACC_SEED = 'StakingPoolAccount';
8540
+ const POOL_ACC_SEED = 'FeePool';
7662
8541
  /**
7663
8542
  * Seed for ComputationAccount PDA
7664
8543
  * @constant {string}
@@ -7720,7 +8599,7 @@ const MAX_EMBIGGEN_IX_PER_TX = 18;
7720
8599
  * @returns The Arcium program's public key.
7721
8600
  */
7722
8601
  function getArciumProgramId() {
7723
- return new PublicKey('BKck65TgoKRokMjQM3datB9oRwJ8rAj2jxPXvHXUvcL6');
8602
+ return new PublicKey('Bv3Fb9VjzjWGfX18QTUcVycAfeLoQ5zZN6vv2g3cTZxp');
7724
8603
  }
7725
8604
  /**
7726
8605
  * Derives the computation account address for a given MXE program ID and offset.
@@ -7751,10 +8630,10 @@ function getExecutingPoolAccAddress(mxeProgramId) {
7751
8630
  return generateArciumPDAFrom(seeds)[0];
7752
8631
  }
7753
8632
  /**
7754
- * Derives the staking pool account address.
7755
- * @returns The derived staking pool account public key.
8633
+ * Derives the fee pool account address.
8634
+ * @returns The derived fee pool account public key.
7756
8635
  */
7757
- function getStakingPoolAccAddress() {
8636
+ function getFeePoolAccAddress() {
7758
8637
  const seeds = [Buffer.from(POOL_ACC_SEED)];
7759
8638
  return generateArciumPDAFrom(seeds)[0];
7760
8639
  }
@@ -7976,14 +8855,36 @@ async function getMXEPublicKey(provider, mxeProgramID) {
7976
8855
  const program = getArciumProgram(provider);
7977
8856
  const mxeAccAddress = getMXEAccAddress(mxeProgramID);
7978
8857
  const mxeAccInfo = await program.account.mxeAccount.fetch(mxeAccAddress);
7979
- if ('set' in mxeAccInfo.x25519Pubkey) {
7980
- const setData = mxeAccInfo.x25519Pubkey.set;
7981
- return new Uint8Array([...setData[0]]);
8858
+ if ('set' in mxeAccInfo.utilityPubkeys) {
8859
+ const setData = mxeAccInfo.utilityPubkeys.set;
8860
+ return new Uint8Array(setData[0].x25519Pubkey);
8861
+ }
8862
+ else if ('unset' in mxeAccInfo.utilityPubkeys) {
8863
+ const unsetData = mxeAccInfo.utilityPubkeys.unset;
8864
+ if (unsetData[1].every(Boolean)) {
8865
+ return new Uint8Array(unsetData[0].x25519Pubkey);
8866
+ }
8867
+ }
8868
+ return null;
8869
+ }
8870
+ /**
8871
+ * Fetches and extracts the MXE arcis ed25519 verifying key from the MXE account.
8872
+ * @param provider - The Anchor provider to use for fetching accounts.
8873
+ * @param mxeProgramID - The public key of the MXE program.
8874
+ * @returns The MXE's arcis ed25519 verifying key as a Uint8Array, or null if not set.
8875
+ */
8876
+ async function getMXEArcisEd25519VerifyingKey(provider, mxeProgramID) {
8877
+ const program = getArciumProgram(provider);
8878
+ const mxeAccAddress = getMXEAccAddress(mxeProgramID);
8879
+ const mxeAccInfo = await program.account.mxeAccount.fetch(mxeAccAddress);
8880
+ if ('set' in mxeAccInfo.utilityPubkeys) {
8881
+ const setData = mxeAccInfo.utilityPubkeys.set;
8882
+ return new Uint8Array(setData[0].ed25519VerifyingKey);
7982
8883
  }
7983
- else if ('unset' in mxeAccInfo.x25519Pubkey) {
7984
- const unsetData = mxeAccInfo.x25519Pubkey.unset;
8884
+ else if ('unset' in mxeAccInfo.utilityPubkeys) {
8885
+ const unsetData = mxeAccInfo.utilityPubkeys.unset;
7985
8886
  if (unsetData[1].every(Boolean)) {
7986
- return new Uint8Array([...unsetData[0]]);
8887
+ return new Uint8Array(unsetData[0].ed25519VerifyingKey);
7987
8888
  }
7988
8889
  }
7989
8890
  return null;
@@ -8244,4 +9145,4 @@ async function awaitEvent(eventListener, eventName, eventCheck, commitment = 'co
8244
9145
  return { event: foundEvent[0], sig: foundEvent[1] };
8245
9146
  }
8246
9147
 
8247
- export { ARCIUM_ADDR, ARCIUM_IDL, Aes128Cipher, Aes192Cipher, Aes256Cipher, CURVE25519_BASE_FIELD, CURVE25519_SCALAR_FIELD_MODULUS, Matrix, RescueCipher, RescueDesc, RescuePrimeHash, arcisEd25519, awaitComputationFinalization, buildFinalizeCompDefTx, compressUint128, decompressUint128, deserializeLE, generateRandomFieldElem, getArciumAccountBaseSeed, getArciumEnv, getArciumProgAddress, getArciumProgram, getArciumProgramId, getArciumProgramReadonly, getArxAccPDA, getArxNodeAccAddress, getClockAccAddress, getClusterAccAddress, getCompDefAccAddress, getCompDefAccOffset, getComputationAccAddress, getExecutingPoolAccAddress, getExecutingPoolAccData, getMXEAccAddress, getMXEPublicKey, getMempoolAccAddress, getMempoolAccData, getStakingPoolAccAddress, positiveModulo, randMatrix, serializeLE, sha256, toVec, uploadCircuit };
9148
+ export { ARCIUM_ADDR, ARCIUM_IDL, Aes128Cipher, Aes192Cipher, Aes256Cipher, CURVE25519_BASE_FIELD, CURVE25519_SCALAR_FIELD_MODULUS, Matrix, RescueCipher, RescueDesc, RescuePrimeHash, arcisEd25519, awaitComputationFinalization, buildFinalizeCompDefTx, compressUint128, decompressUint128, deserializeLE, generateRandomFieldElem, getArciumAccountBaseSeed, getArciumEnv, getArciumProgAddress, getArciumProgram, getArciumProgramId, getArciumProgramReadonly, getArxAccPDA, getArxNodeAccAddress, getClockAccAddress, getClusterAccAddress, getCompDefAccAddress, getCompDefAccOffset, getComputationAccAddress, getExecutingPoolAccAddress, getExecutingPoolAccData, getFeePoolAccAddress, getMXEAccAddress, getMXEArcisEd25519VerifyingKey, getMXEPublicKey, getMempoolAccAddress, getMempoolAccData, positiveModulo, randMatrix, serializeLE, sha256, toVec, uploadCircuit };