@arcium-hq/client 0.3.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.3.0",
1294
+ version: "0.4.0",
1256
1295
  spec: "0.1.0",
1257
1296
  description: "The Arcium program"
1258
1297
  };
@@ -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(ArciumError ::\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(ArciumError ::\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(ArciumError ::\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,40 +2053,124 @@ var instructions = [
1933
2053
  },
1934
2054
  {
1935
2055
  kind: "account",
1936
- path: "arx_node_acc.cluster_memberships.get(4).ok_or(ArciumError ::\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(ArciumError ::\nInvalidClusterMembership) ? ",
1962
- account: "ArxNode"
2082
+ kind: "arg",
2083
+ path: "_mxe_program"
1963
2084
  }
1964
2085
  ]
1965
2086
  }
1966
- },
1967
- {
1968
- name: "cluster_acc_6",
1969
- optional: true,
2087
+ }
2088
+ ],
2089
+ args: [
2090
+ {
2091
+ name: "comp_offset",
2092
+ type: "u64"
2093
+ },
2094
+ {
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,
1970
2174
  pda: {
1971
2175
  seeds: [
1972
2176
  {
@@ -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(ArciumError ::\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(ArciumError ::\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(ArciumError ::\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(ArciumError ::\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,283 +2413,280 @@ 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"
2150
- },
2151
- {
2152
- name: "deactivation_epoch",
2153
- type: {
2154
- defined: {
2155
- name: "Epoch"
2156
- }
2157
- }
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
- },
2181
- {
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",
2416
+ name: "cluster_acc_0",
2417
+ optional: true,
2226
2418
  pda: {
2227
2419
  seeds: [
2228
2420
  {
2229
2421
  kind: "const",
2230
2422
  value: [
2231
2423
  67,
2232
- 111,
2233
- 109,
2234
- 112,
2424
+ 108,
2235
2425
  117,
2426
+ 115,
2236
2427
  116,
2237
- 97,
2238
- 116,
2239
- 105,
2240
- 111,
2241
- 110,
2242
- 68,
2243
2428
  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
2429
+ 114
2259
2430
  ]
2260
2431
  },
2261
2432
  {
2262
- kind: "arg",
2263
- path: "_mxe_program"
2433
+ kind: "account",
2434
+ path: "arx_node_acc.cluster_memberships",
2435
+ account: "ArxNode"
2436
+ }
2437
+ ]
2438
+ }
2439
+ },
2440
+ {
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
+ ]
2264
2456
  },
2265
2457
  {
2266
- kind: "arg",
2267
- path: "_comp_offset"
2458
+ kind: "account",
2459
+ path: "arx_node_acc.cluster_memberships.get(1).ok_or(ArciumError ::\nInvalidClusterMembership) ? ",
2460
+ account: "ArxNode"
2268
2461
  }
2269
2462
  ]
2270
2463
  }
2271
2464
  },
2272
2465
  {
2273
- name: "comp_def_raw",
2274
- writable: true,
2466
+ name: "cluster_acc_2",
2467
+ optional: true,
2275
2468
  pda: {
2276
2469
  seeds: [
2277
2470
  {
2278
2471
  kind: "const",
2279
2472
  value: [
2280
2473
  67,
2281
- 111,
2282
- 109,
2283
- 112,
2474
+ 108,
2284
2475
  117,
2476
+ 115,
2285
2477
  116,
2286
- 97,
2287
- 116,
2288
- 105,
2289
- 111,
2290
- 110,
2291
- 68,
2292
2478
  101,
2293
- 102,
2294
- 105,
2295
- 110,
2296
- 105,
2297
- 116,
2298
- 105,
2299
- 111,
2300
- 110,
2301
- 82,
2302
- 97,
2303
- 119
2479
+ 114
2304
2480
  ]
2305
2481
  },
2306
2482
  {
2307
2483
  kind: "account",
2308
- path: "comp_def_acc"
2484
+ path: "arx_node_acc.cluster_memberships.get(2).ok_or(ArciumError ::\nInvalidClusterMembership) ? ",
2485
+ account: "ArxNode"
2486
+ }
2487
+ ]
2488
+ }
2489
+ },
2490
+ {
2491
+ name: "cluster_acc_3",
2492
+ optional: true,
2493
+ pda: {
2494
+ seeds: [
2495
+ {
2496
+ kind: "const",
2497
+ value: [
2498
+ 67,
2499
+ 108,
2500
+ 117,
2501
+ 115,
2502
+ 116,
2503
+ 101,
2504
+ 114
2505
+ ]
2309
2506
  },
2310
2507
  {
2311
- kind: "arg",
2312
- path: "_raw_circuit_index"
2508
+ kind: "account",
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"
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
+ }
2326
2539
  },
2327
2540
  {
2328
- name: "mxe_program",
2329
- type: "pubkey"
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
+ }
2330
2564
  },
2331
2565
  {
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
2566
+ name: "cluster_acc_6",
2567
+ optional: true,
2568
+ pda: {
2569
+ seeds: [
2570
+ {
2571
+ kind: "const",
2572
+ value: [
2573
+ 67,
2574
+ 108,
2575
+ 117,
2576
+ 115,
2577
+ 116,
2578
+ 101,
2579
+ 114
2580
+ ]
2581
+ },
2582
+ {
2583
+ kind: "account",
2584
+ path: "arx_node_acc.cluster_memberships.get(6).ok_or(ArciumError ::\nInvalidClusterMembership) ? ",
2585
+ account: "ArxNode"
2586
+ }
2587
+ ]
2588
+ }
2354
2589
  },
2355
2590
  {
2356
- name: "comp",
2357
- writable: true,
2591
+ name: "cluster_acc_7",
2592
+ optional: true,
2358
2593
  pda: {
2359
2594
  seeds: [
2360
2595
  {
2361
2596
  kind: "const",
2362
2597
  value: [
2363
2598
  67,
2364
- 111,
2365
- 109,
2366
- 112,
2599
+ 108,
2367
2600
  117,
2601
+ 115,
2368
2602
  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
2603
+ 101,
2604
+ 114
2381
2605
  ]
2382
2606
  },
2383
2607
  {
2384
- kind: "arg",
2385
- path: "_mxe_program"
2608
+ kind: "account",
2609
+ path: "arx_node_acc.cluster_memberships.get(7).ok_or(ArciumError ::\nInvalidClusterMembership) ? ",
2610
+ account: "ArxNode"
2611
+ }
2612
+ ]
2613
+ }
2614
+ },
2615
+ {
2616
+ name: "cluster_acc_8",
2617
+ optional: true,
2618
+ pda: {
2619
+ seeds: [
2620
+ {
2621
+ kind: "const",
2622
+ value: [
2623
+ 67,
2624
+ 108,
2625
+ 117,
2626
+ 115,
2627
+ 116,
2628
+ 101,
2629
+ 114
2630
+ ]
2386
2631
  },
2387
2632
  {
2388
- kind: "arg",
2389
- path: "comp_offset"
2633
+ kind: "account",
2634
+ path: "arx_node_acc.cluster_memberships.get(8).ok_or(ArciumError ::\nInvalidClusterMembership) ? ",
2635
+ account: "ArxNode"
2390
2636
  }
2391
2637
  ]
2392
2638
  }
2393
2639
  },
2394
2640
  {
2395
- name: "mxe",
2641
+ name: "cluster_acc_9",
2642
+ optional: true,
2396
2643
  pda: {
2397
2644
  seeds: [
2398
2645
  {
2399
2646
  kind: "const",
2400
2647
  value: [
2401
- 77,
2402
- 88,
2403
- 69,
2404
- 65,
2405
- 99,
2406
- 99,
2407
- 111,
2648
+ 67,
2649
+ 108,
2408
2650
  117,
2409
- 110,
2410
- 116
2651
+ 115,
2652
+ 116,
2653
+ 101,
2654
+ 114
2411
2655
  ]
2412
2656
  },
2413
2657
  {
2414
- kind: "arg",
2415
- path: "_mxe_program"
2658
+ kind: "account",
2659
+ path: "arx_node_acc.cluster_memberships.get(9).ok_or(ArciumError ::\nInvalidClusterMembership) ? ",
2660
+ account: "ArxNode"
2416
2661
  }
2417
2662
  ]
2418
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
2419
2690
  },
2420
2691
  {
2421
2692
  name: "cluster_acc",
@@ -2435,61 +2706,118 @@ var instructions = [
2435
2706
  ]
2436
2707
  },
2437
2708
  {
2438
- kind: "account",
2439
- path: "mxe.cluster.ok_or(ArciumError :: ClusterNotSet) ? ",
2440
- account: "MXEAccount"
2709
+ kind: "arg",
2710
+ path: "_id"
2441
2711
  }
2442
2712
  ]
2443
2713
  }
2444
2714
  },
2445
2715
  {
2446
- name: "executing_pool",
2447
- writable: true,
2716
+ name: "clock",
2448
2717
  pda: {
2449
2718
  seeds: [
2450
2719
  {
2451
2720
  kind: "const",
2452
2721
  value: [
2453
- 69,
2454
- 120,
2455
- 101,
2456
- 99,
2457
- 112,
2722
+ 67,
2723
+ 108,
2458
2724
  111,
2725
+ 99,
2726
+ 107,
2727
+ 65,
2728
+ 99,
2729
+ 99,
2459
2730
  111,
2460
- 108
2731
+ 117,
2732
+ 110,
2733
+ 116
2461
2734
  ]
2462
- },
2463
- {
2464
- kind: "arg",
2465
- path: "_mxe_program"
2466
2735
  }
2467
2736
  ]
2468
2737
  }
2469
2738
  },
2470
2739
  {
2471
- name: "mempool",
2472
- writable: true,
2473
- pda: {
2474
- seeds: [
2475
- {
2476
- kind: "const",
2477
- value: [
2478
- 77,
2479
- 101,
2480
- 109,
2481
- 112,
2482
- 111,
2483
- 111,
2484
- 108
2485
- ]
2486
- },
2487
- {
2488
- kind: "arg",
2489
- path: "_mxe_program"
2490
- }
2491
- ]
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
+ }
2492
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
2493
2821
  },
2494
2822
  {
2495
2823
  name: "comp_def_acc",
@@ -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
  },
@@ -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: [
@@ -4413,16 +4758,100 @@ var instructions = [
4413
4758
  }
4414
4759
  },
4415
4760
  {
4416
- name: "input_delivery_fee",
4761
+ name: "callback_transactions_required",
4762
+ type: "u8"
4763
+ },
4764
+ {
4765
+ name: "output_delivery_fee",
4766
+ type: "u64"
4767
+ },
4768
+ {
4769
+ name: "cu_price_micro",
4770
+ type: "u64"
4771
+ }
4772
+ ]
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",
4417
4846
  type: "u64"
4418
4847
  },
4419
4848
  {
4420
- name: "output_delivery_fee",
4421
- type: "u64"
4849
+ name: "node_offset",
4850
+ type: "u32"
4422
4851
  },
4423
4852
  {
4424
- name: "cu_price_micro",
4425
- type: "u64"
4853
+ name: "mxe_program",
4854
+ type: "pubkey"
4426
4855
  }
4427
4856
  ]
4428
4857
  },
@@ -4817,6 +5246,33 @@ var instructions = [
4817
5246
  32
4818
5247
  ]
4819
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
+ }
4820
5276
  }
4821
5277
  ]
4822
5278
  },
@@ -5167,6 +5623,19 @@ var accounts = [
5167
5623
  136
5168
5624
  ]
5169
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
+ },
5170
5639
  {
5171
5640
  name: "FeePool",
5172
5641
  discriminator: [
@@ -5325,6 +5794,19 @@ var events = [
5325
5794
  19
5326
5795
  ]
5327
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
+ },
5328
5810
  {
5329
5811
  name: "FinalizeComputationEvent",
5330
5812
  discriminator: [
@@ -5338,6 +5820,19 @@ var events = [
5338
5820
  249
5339
5821
  ]
5340
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
+ },
5341
5836
  {
5342
5837
  name: "InitComputationEvent",
5343
5838
  discriminator: [
@@ -5458,8 +5953,8 @@ var errors = [
5458
5953
  },
5459
5954
  {
5460
5955
  code: 6205,
5461
- name: "InvalidFinalizeTx",
5462
- msg: "Finalize tx is invalid"
5956
+ name: "InvalidCallbackTx",
5957
+ msg: "Callback tx is invalid"
5463
5958
  },
5464
5959
  {
5465
5960
  code: 6206,
@@ -5664,8 +6159,17 @@ var types = [
5664
6159
  {
5665
6160
  name: "PrimitiveError"
5666
6161
  },
6162
+ {
6163
+ name: "InvalidBatchLength"
6164
+ },
5667
6165
  {
5668
6166
  name: "QuadraticNonResidue"
6167
+ },
6168
+ {
6169
+ name: "BitConversionError"
6170
+ },
6171
+ {
6172
+ name: "ChannelClosed"
5669
6173
  }
5670
6174
  ]
5671
6175
  }
@@ -6085,6 +6589,22 @@ var types = [
6085
6589
  ]
6086
6590
  }
6087
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
+ },
6088
6608
  {
6089
6609
  name: "ClockAccount",
6090
6610
  docs: [
@@ -6309,6 +6829,14 @@ var types = [
6309
6829
  }
6310
6830
  }
6311
6831
  },
6832
+ {
6833
+ name: "callback_transactions_required",
6834
+ type: "u8"
6835
+ },
6836
+ {
6837
+ name: "callback_transactions_submitted_bm",
6838
+ type: "u16"
6839
+ },
6312
6840
  {
6313
6841
  name: "bump",
6314
6842
  type: "u8"
@@ -6333,13 +6861,6 @@ var types = [
6333
6861
  option: "pubkey"
6334
6862
  }
6335
6863
  },
6336
- {
6337
- name: "finalize_during_callback",
6338
- docs: [
6339
- "Whether to we need a separate callback and finalize instruction or if we can do it in one."
6340
- ],
6341
- type: "bool"
6342
- },
6343
6864
  {
6344
6865
  name: "cu_amount",
6345
6866
  docs: [
@@ -6509,9 +7030,6 @@ var types = [
6509
7030
  {
6510
7031
  name: "Queued"
6511
7032
  },
6512
- {
6513
- name: "Executed"
6514
- },
6515
7033
  {
6516
7034
  name: "Finalized"
6517
7035
  }
@@ -6550,21 +7068,12 @@ var types = [
6550
7068
  name: "bump",
6551
7069
  type: "u8"
6552
7070
  },
6553
- {
6554
- name: "comp_status",
6555
- type: {
6556
- array: [
6557
- "u8",
6558
- 13
6559
- ]
6560
- }
6561
- },
6562
7071
  {
6563
7072
  name: "padding",
6564
7073
  type: {
6565
7074
  array: [
6566
7075
  "u8",
6567
- 2
7076
+ 7
6568
7077
  ]
6569
7078
  }
6570
7079
  },
@@ -6656,18 +7165,10 @@ var types = [
6656
7165
  ],
6657
7166
  type: "u64"
6658
7167
  },
6659
- {
6660
- name: "input_delivery_fee",
6661
- docs: [
6662
- "A fee for data relaying used with [super::mxe::DataProvisioning::Protected] data",
6663
- "provisioning."
6664
- ],
6665
- type: "u64"
6666
- },
6667
7168
  {
6668
7169
  name: "output_delivery_fee",
6669
7170
  docs: [
6670
- "A fee for relayer based (unverifiable) off-chain output delivery."
7171
+ "A fee for output delivery fees (i.e. tx fees)."
6671
7172
  ],
6672
7173
  type: "u64"
6673
7174
  }
@@ -6701,6 +7202,43 @@ var types = [
6701
7202
  ]
6702
7203
  }
6703
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
+ },
6704
7242
  {
6705
7243
  name: "FeePool",
6706
7244
  type: {
@@ -6729,6 +7267,22 @@ var types = [
6729
7267
  ]
6730
7268
  }
6731
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
+ },
6732
7286
  {
6733
7287
  name: "InitComputationEvent",
6734
7288
  type: {
@@ -6963,13 +7517,27 @@ var types = [
6963
7517
  }
6964
7518
  },
6965
7519
  {
6966
- name: "x25519_pubkey",
7520
+ name: "utility_pubkeys",
6967
7521
  docs: [
6968
- "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"
6969
7527
  ],
6970
7528
  type: {
6971
7529
  defined: {
6972
- name: "X25519Pubkey"
7530
+ name: "SetUnset",
7531
+ generics: [
7532
+ {
7533
+ kind: "type",
7534
+ type: {
7535
+ defined: {
7536
+ name: "UtilityPubkeys"
7537
+ }
7538
+ }
7539
+ }
7540
+ ]
6973
7541
  }
6974
7542
  }
6975
7543
  },
@@ -7409,6 +7977,9 @@ var types = [
7409
7977
  },
7410
7978
  {
7411
7979
  name: "PlaintextFloat"
7980
+ },
7981
+ {
7982
+ name: "PlaintextPoint"
7412
7983
  }
7413
7984
  ]
7414
7985
  }
@@ -7480,6 +8051,39 @@ var types = [
7480
8051
  ]
7481
8052
  }
7482
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
+ },
7483
8087
  {
7484
8088
  name: "SmallExecPool",
7485
8089
  serialization: "bytemuckunsafe",
@@ -7853,34 +8457,45 @@ var types = [
7853
8457
  }
7854
8458
  },
7855
8459
  {
7856
- name: "X25519Pubkey",
8460
+ name: "UtilityPubkeys",
7857
8461
  type: {
7858
- kind: "enum",
7859
- variants: [
8462
+ kind: "struct",
8463
+ fields: [
7860
8464
  {
7861
- name: "Set",
7862
- fields: [
7863
- {
7864
- array: [
7865
- "u8",
7866
- 32
7867
- ]
7868
- }
7869
- ]
8465
+ name: "x25519_pubkey",
8466
+ type: {
8467
+ array: [
8468
+ "u8",
8469
+ 32
8470
+ ]
8471
+ }
7870
8472
  },
7871
8473
  {
7872
- name: "Unset",
7873
- fields: [
7874
- {
7875
- array: [
7876
- "u8",
7877
- 32
7878
- ]
7879
- },
7880
- {
7881
- vec: "bool"
7882
- }
7883
- ]
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
+ }
7884
8499
  }
7885
8500
  ]
7886
8501
  }
@@ -7919,10 +8534,10 @@ const ARCIUM_ADDR = address;
7919
8534
  */
7920
8535
  const CLOCK_ACC_SEED = 'ClockAccount';
7921
8536
  /**
7922
- * Seed for StakingPoolAccount PDA
8537
+ * Seed for FeePool PDA
7923
8538
  * @constant {string}
7924
8539
  */
7925
- const POOL_ACC_SEED = 'StakingPoolAccount';
8540
+ const POOL_ACC_SEED = 'FeePool';
7926
8541
  /**
7927
8542
  * Seed for ComputationAccount PDA
7928
8543
  * @constant {string}
@@ -7984,7 +8599,7 @@ const MAX_EMBIGGEN_IX_PER_TX = 18;
7984
8599
  * @returns The Arcium program's public key.
7985
8600
  */
7986
8601
  function getArciumProgramId() {
7987
- return new PublicKey('BKck65TgoKRokMjQM3datB9oRwJ8rAj2jxPXvHXUvcL6');
8602
+ return new PublicKey('Bv3Fb9VjzjWGfX18QTUcVycAfeLoQ5zZN6vv2g3cTZxp');
7988
8603
  }
7989
8604
  /**
7990
8605
  * Derives the computation account address for a given MXE program ID and offset.
@@ -8015,10 +8630,10 @@ function getExecutingPoolAccAddress(mxeProgramId) {
8015
8630
  return generateArciumPDAFrom(seeds)[0];
8016
8631
  }
8017
8632
  /**
8018
- * Derives the staking pool account address.
8019
- * @returns The derived staking pool account public key.
8633
+ * Derives the fee pool account address.
8634
+ * @returns The derived fee pool account public key.
8020
8635
  */
8021
- function getStakingPoolAccAddress() {
8636
+ function getFeePoolAccAddress() {
8022
8637
  const seeds = [Buffer.from(POOL_ACC_SEED)];
8023
8638
  return generateArciumPDAFrom(seeds)[0];
8024
8639
  }
@@ -8240,14 +8855,36 @@ async function getMXEPublicKey(provider, mxeProgramID) {
8240
8855
  const program = getArciumProgram(provider);
8241
8856
  const mxeAccAddress = getMXEAccAddress(mxeProgramID);
8242
8857
  const mxeAccInfo = await program.account.mxeAccount.fetch(mxeAccAddress);
8243
- if ('set' in mxeAccInfo.x25519Pubkey) {
8244
- const setData = mxeAccInfo.x25519Pubkey.set;
8245
- 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);
8246
8883
  }
8247
- else if ('unset' in mxeAccInfo.x25519Pubkey) {
8248
- const unsetData = mxeAccInfo.x25519Pubkey.unset;
8884
+ else if ('unset' in mxeAccInfo.utilityPubkeys) {
8885
+ const unsetData = mxeAccInfo.utilityPubkeys.unset;
8249
8886
  if (unsetData[1].every(Boolean)) {
8250
- return new Uint8Array([...unsetData[0]]);
8887
+ return new Uint8Array(unsetData[0].ed25519VerifyingKey);
8251
8888
  }
8252
8889
  }
8253
8890
  return null;
@@ -8508,4 +9145,4 @@ async function awaitEvent(eventListener, eventName, eventCheck, commitment = 'co
8508
9145
  return { event: foundEvent[0], sig: foundEvent[1] };
8509
9146
  }
8510
9147
 
8511
- 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 };