@obolnetwork/obol-sdk 2.12.6 → 2.13.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/dist/browser/src/index.js +278 -76
- package/dist/browser/src/index.js.map +1 -1
- package/dist/cjs/src/index.js +241 -50
- package/dist/cjs/src/index.js.map +1 -1
- package/dist/cjs/src/verification/clusterLockValidationWorker.js +207 -16
- package/dist/cjs/src/verification/clusterLockValidationWorker.js.map +1 -1
- package/dist/esm/src/{chunk-GLSVKGK3.js → chunk-EITEAAK3.js} +244 -42
- package/dist/esm/src/chunk-EITEAAK3.js.map +1 -0
- package/dist/esm/src/index.js +2 -2
- package/dist/esm/src/index.js.map +1 -1
- package/dist/esm/src/verification/clusterLockValidationWorker.js +1 -1
- package/dist/types/src/constants.d.ts +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/verification/sszTypes.d.ts +14 -1
- package/dist/types/src/verification/v1.11.0.d.ts +29 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/esm/src/chunk-GLSVKGK3.js.map +0 -1
|
@@ -40,7 +40,7 @@ var FORK_NAMES = {
|
|
|
40
40
|
// package.json
|
|
41
41
|
var package_default = {
|
|
42
42
|
name: "@obolnetwork/obol-sdk",
|
|
43
|
-
version: "2.
|
|
43
|
+
version: "2.13.0",
|
|
44
44
|
description: "A package for creating Distributed Validators using the Obol API.",
|
|
45
45
|
bugs: {
|
|
46
46
|
url: "https://github.com/obolnetwork/obol-sdk/issues"
|
|
@@ -323,7 +323,7 @@ var signEnrPayload = (payload, chainId) => {
|
|
|
323
323
|
};
|
|
324
324
|
};
|
|
325
325
|
var DKG_ALGORITHM = "default";
|
|
326
|
-
var CONFIG_VERSION = "v1.
|
|
326
|
+
var CONFIG_VERSION = "v1.11.0";
|
|
327
327
|
var SDK_VERSION = package_default.version;
|
|
328
328
|
var DOMAIN_APPLICATION_BUILDER = "00000001";
|
|
329
329
|
var DOMAIN_DEPOSIT = "03000000";
|
|
@@ -8987,7 +8987,7 @@ var validateSmartContractSignature = (_0) => __async(null, [_0], function* ({
|
|
|
8987
8987
|
});
|
|
8988
8988
|
|
|
8989
8989
|
// src/verification/common.ts
|
|
8990
|
-
import { fromHexString as
|
|
8990
|
+
import { fromHexString as fromHexString6 } from "@chainsafe/ssz";
|
|
8991
8991
|
import elliptic from "elliptic";
|
|
8992
8992
|
import * as semver from "semver";
|
|
8993
8993
|
|
|
@@ -9001,6 +9001,7 @@ import {
|
|
|
9001
9001
|
ByteListType,
|
|
9002
9002
|
ByteVectorType,
|
|
9003
9003
|
ContainerType,
|
|
9004
|
+
ListCompositeType,
|
|
9004
9005
|
UintNumberType
|
|
9005
9006
|
} from "@chainsafe/ssz";
|
|
9006
9007
|
var operatorAddressWrapperType = new ContainerType({
|
|
@@ -9016,10 +9017,25 @@ var operatorContainerType = new ContainerType({
|
|
|
9016
9017
|
config_signature: new ByteVectorType(65),
|
|
9017
9018
|
enr_signature: new ByteVectorType(65)
|
|
9018
9019
|
});
|
|
9020
|
+
var k1SignatureListType = new ListCompositeType(
|
|
9021
|
+
new ByteVectorType(65),
|
|
9022
|
+
32
|
|
9023
|
+
);
|
|
9024
|
+
var operatorContainerTypeV1X11 = new ContainerType({
|
|
9025
|
+
address: new ByteVectorType(20),
|
|
9026
|
+
enr: new ByteListType(1024),
|
|
9027
|
+
// This needs to be dynamic, since ENRs do not have a fixed length.
|
|
9028
|
+
config_signature: k1SignatureListType,
|
|
9029
|
+
enr_signature: k1SignatureListType
|
|
9030
|
+
});
|
|
9019
9031
|
var creatorContainerType = new ContainerType({
|
|
9020
9032
|
address: new ByteVectorType(20),
|
|
9021
9033
|
config_signature: new ByteVectorType(65)
|
|
9022
9034
|
});
|
|
9035
|
+
var creatorContainerTypeV1X11 = new ContainerType({
|
|
9036
|
+
address: new ByteVectorType(20),
|
|
9037
|
+
config_signature: k1SignatureListType
|
|
9038
|
+
});
|
|
9023
9039
|
var validatorsContainerType = new ContainerType({
|
|
9024
9040
|
fee_recipient_address: new ByteVectorType(20),
|
|
9025
9041
|
withdrawal_address: new ByteVectorType(20)
|
|
@@ -9027,9 +9043,15 @@ var validatorsContainerType = new ContainerType({
|
|
|
9027
9043
|
var newCreatorContainerType = (configOnly) => {
|
|
9028
9044
|
return configOnly ? creatorAddressWrapperType : creatorContainerType;
|
|
9029
9045
|
};
|
|
9046
|
+
var newCreatorContainerTypeV1X11 = (configOnly) => {
|
|
9047
|
+
return configOnly ? creatorAddressWrapperType : creatorContainerTypeV1X11;
|
|
9048
|
+
};
|
|
9030
9049
|
var newOperatorContainerType = (configOnly) => {
|
|
9031
9050
|
return configOnly ? operatorAddressWrapperType : operatorContainerType;
|
|
9032
9051
|
};
|
|
9052
|
+
var newOperatorContainerTypeV1X11 = (configOnly) => {
|
|
9053
|
+
return configOnly ? operatorAddressWrapperType : operatorContainerTypeV1X11;
|
|
9054
|
+
};
|
|
9033
9055
|
var depositDataContainer = new ContainerType({
|
|
9034
9056
|
pubkey: new ByteVectorType(48),
|
|
9035
9057
|
withdrawal_credentials: new ByteVectorType(32),
|
|
@@ -9071,7 +9093,7 @@ import {
|
|
|
9071
9093
|
ByteListType as ByteListType2,
|
|
9072
9094
|
ByteVectorType as ByteVectorType2,
|
|
9073
9095
|
ContainerType as ContainerType2,
|
|
9074
|
-
ListCompositeType,
|
|
9096
|
+
ListCompositeType as ListCompositeType2,
|
|
9075
9097
|
fromHexString
|
|
9076
9098
|
} from "@chainsafe/ssz";
|
|
9077
9099
|
var clusterDefinitionContainerTypeV1X6 = (configOnly) => {
|
|
@@ -9084,9 +9106,9 @@ var clusterDefinitionContainerTypeV1X6 = (configOnly) => {
|
|
|
9084
9106
|
threshold: new UintNumberType2(8),
|
|
9085
9107
|
dkg_algorithm: new ByteListType2(32),
|
|
9086
9108
|
fork_version: new ByteVectorType2(4),
|
|
9087
|
-
operators: new
|
|
9109
|
+
operators: new ListCompositeType2(newOperatorContainerType(configOnly), 256),
|
|
9088
9110
|
creator: newCreatorContainerType(configOnly),
|
|
9089
|
-
validators: new
|
|
9111
|
+
validators: new ListCompositeType2(validatorsContainerType, 65536)
|
|
9090
9112
|
};
|
|
9091
9113
|
if (!configOnly) {
|
|
9092
9114
|
returnedContainerType = __spreadProps(__spreadValues({}, returnedContainerType), {
|
|
@@ -9133,7 +9155,7 @@ var hashClusterDefinitionV1X6 = (cluster, configOnly) => {
|
|
|
9133
9155
|
};
|
|
9134
9156
|
var dvContainerTypeV1X6 = new ContainerType2({
|
|
9135
9157
|
distributed_public_key: new ByteVectorType2(48),
|
|
9136
|
-
public_shares: new
|
|
9158
|
+
public_shares: new ListCompositeType2(new ByteVectorType2(48), 256),
|
|
9137
9159
|
pubkey: new ByteVectorType2(48),
|
|
9138
9160
|
withdrawal_credentials: new ByteVectorType2(32),
|
|
9139
9161
|
amount: new UintNumberType2(8),
|
|
@@ -9142,7 +9164,7 @@ var dvContainerTypeV1X6 = new ContainerType2({
|
|
|
9142
9164
|
var clusterLockContainerTypeV1X6 = () => {
|
|
9143
9165
|
return new ContainerType2({
|
|
9144
9166
|
cluster_definition: clusterDefinitionContainerTypeV1X6(false),
|
|
9145
|
-
distributed_validators: new
|
|
9167
|
+
distributed_validators: new ListCompositeType2(dvContainerTypeV1X6, 65536)
|
|
9146
9168
|
});
|
|
9147
9169
|
};
|
|
9148
9170
|
var hashClusterLockV1X6 = (cluster) => {
|
|
@@ -9240,7 +9262,7 @@ import {
|
|
|
9240
9262
|
ByteListType as ByteListType3,
|
|
9241
9263
|
ByteVectorType as ByteVectorType3,
|
|
9242
9264
|
ContainerType as ContainerType3,
|
|
9243
|
-
ListCompositeType as
|
|
9265
|
+
ListCompositeType as ListCompositeType3,
|
|
9244
9266
|
fromHexString as fromHexString2
|
|
9245
9267
|
} from "@chainsafe/ssz";
|
|
9246
9268
|
var clusterDefinitionContainerTypeV1X7 = (configOnly) => {
|
|
@@ -9253,9 +9275,9 @@ var clusterDefinitionContainerTypeV1X7 = (configOnly) => {
|
|
|
9253
9275
|
threshold: new UintNumberType3(8),
|
|
9254
9276
|
dkg_algorithm: new ByteListType3(32),
|
|
9255
9277
|
fork_version: new ByteVectorType3(4),
|
|
9256
|
-
operators: new
|
|
9278
|
+
operators: new ListCompositeType3(newOperatorContainerType(configOnly), 256),
|
|
9257
9279
|
creator: newCreatorContainerType(configOnly),
|
|
9258
|
-
validators: new
|
|
9280
|
+
validators: new ListCompositeType3(validatorsContainerType, 65536)
|
|
9259
9281
|
};
|
|
9260
9282
|
if (!configOnly) {
|
|
9261
9283
|
returnedContainerType = __spreadProps(__spreadValues({}, returnedContainerType), {
|
|
@@ -9302,14 +9324,14 @@ var hashClusterDefinitionV1X7 = (cluster, configOnly) => {
|
|
|
9302
9324
|
};
|
|
9303
9325
|
var dvContainerTypeV1X7 = new ContainerType3({
|
|
9304
9326
|
distributed_public_key: new ByteVectorType3(48),
|
|
9305
|
-
public_shares: new
|
|
9327
|
+
public_shares: new ListCompositeType3(new ByteVectorType3(48), 256),
|
|
9306
9328
|
deposit_data: depositDataContainer,
|
|
9307
9329
|
builder_registration: builderRegistrationContainer
|
|
9308
9330
|
});
|
|
9309
9331
|
var clusterLockContainerTypeV1X7 = () => {
|
|
9310
9332
|
return new ContainerType3({
|
|
9311
9333
|
cluster_definition: clusterDefinitionContainerTypeV1X7(false),
|
|
9312
|
-
distributed_validators: new
|
|
9334
|
+
distributed_validators: new ListCompositeType3(dvContainerTypeV1X7, 65536)
|
|
9313
9335
|
});
|
|
9314
9336
|
};
|
|
9315
9337
|
var hashClusterLockV1X7 = (cluster) => {
|
|
@@ -9437,7 +9459,7 @@ import {
|
|
|
9437
9459
|
ByteVectorType as ByteVectorType4,
|
|
9438
9460
|
ContainerType as ContainerType4,
|
|
9439
9461
|
ListBasicType,
|
|
9440
|
-
ListCompositeType as
|
|
9462
|
+
ListCompositeType as ListCompositeType4,
|
|
9441
9463
|
fromHexString as fromHexString3
|
|
9442
9464
|
} from "@chainsafe/ssz";
|
|
9443
9465
|
var clusterDefinitionContainerTypeV1X8 = (configOnly) => {
|
|
@@ -9450,9 +9472,9 @@ var clusterDefinitionContainerTypeV1X8 = (configOnly) => {
|
|
|
9450
9472
|
threshold: new UintNumberType4(8),
|
|
9451
9473
|
dkg_algorithm: new ByteListType4(32),
|
|
9452
9474
|
fork_version: new ByteVectorType4(4),
|
|
9453
|
-
operators: new
|
|
9475
|
+
operators: new ListCompositeType4(newOperatorContainerType(configOnly), 256),
|
|
9454
9476
|
creator: newCreatorContainerType(configOnly),
|
|
9455
|
-
validators: new
|
|
9477
|
+
validators: new ListCompositeType4(validatorsContainerType, 65536),
|
|
9456
9478
|
deposit_amounts: new ListBasicType(
|
|
9457
9479
|
new UintNumberType4(8),
|
|
9458
9480
|
256
|
|
@@ -9508,14 +9530,14 @@ var hashClusterDefinitionV1X8 = (cluster, configOnly) => {
|
|
|
9508
9530
|
};
|
|
9509
9531
|
var dvContainerTypeV1X8 = new ContainerType4({
|
|
9510
9532
|
distributed_public_key: new ByteVectorType4(48),
|
|
9511
|
-
public_shares: new
|
|
9512
|
-
partial_deposit_data: new
|
|
9533
|
+
public_shares: new ListCompositeType4(new ByteVectorType4(48), 256),
|
|
9534
|
+
partial_deposit_data: new ListCompositeType4(depositDataContainer, 256),
|
|
9513
9535
|
builder_registration: builderRegistrationContainer
|
|
9514
9536
|
});
|
|
9515
9537
|
var clusterLockContainerTypeV1X8 = () => {
|
|
9516
9538
|
return new ContainerType4({
|
|
9517
9539
|
cluster_definition: clusterDefinitionContainerTypeV1X8(false),
|
|
9518
|
-
distributed_validators: new
|
|
9540
|
+
distributed_validators: new ListCompositeType4(dvContainerTypeV1X8, 65536)
|
|
9519
9541
|
});
|
|
9520
9542
|
};
|
|
9521
9543
|
var hashClusterLockV1X8 = (cluster) => {
|
|
@@ -9661,7 +9683,7 @@ import {
|
|
|
9661
9683
|
ByteVectorType as ByteVectorType5,
|
|
9662
9684
|
ContainerType as ContainerType5,
|
|
9663
9685
|
ListBasicType as ListBasicType2,
|
|
9664
|
-
ListCompositeType as
|
|
9686
|
+
ListCompositeType as ListCompositeType5,
|
|
9665
9687
|
fromHexString as fromHexString4,
|
|
9666
9688
|
BooleanType
|
|
9667
9689
|
} from "@chainsafe/ssz";
|
|
@@ -9675,9 +9697,9 @@ var clusterDefinitionContainerTypeV1X10 = (configOnly) => {
|
|
|
9675
9697
|
threshold: new UintNumberType5(8),
|
|
9676
9698
|
dkg_algorithm: new ByteListType5(32),
|
|
9677
9699
|
fork_version: new ByteVectorType5(4),
|
|
9678
|
-
operators: new
|
|
9700
|
+
operators: new ListCompositeType5(newOperatorContainerType(configOnly), 256),
|
|
9679
9701
|
creator: newCreatorContainerType(configOnly),
|
|
9680
|
-
validators: new
|
|
9702
|
+
validators: new ListCompositeType5(validatorsContainerType, 65536),
|
|
9681
9703
|
deposit_amounts: new ListBasicType2(
|
|
9682
9704
|
new UintNumberType5(8),
|
|
9683
9705
|
256
|
|
@@ -9745,14 +9767,14 @@ var hashClusterDefinitionV1X10 = (cluster, configOnly) => {
|
|
|
9745
9767
|
};
|
|
9746
9768
|
var dvContainerTypeV1X10 = new ContainerType5({
|
|
9747
9769
|
distributed_public_key: new ByteVectorType5(48),
|
|
9748
|
-
public_shares: new
|
|
9749
|
-
partial_deposit_data: new
|
|
9770
|
+
public_shares: new ListCompositeType5(new ByteVectorType5(48), 256),
|
|
9771
|
+
partial_deposit_data: new ListCompositeType5(depositDataContainer, 256),
|
|
9750
9772
|
builder_registration: builderRegistrationContainer
|
|
9751
9773
|
});
|
|
9752
9774
|
var clusterLockContainerTypeV1X10 = () => {
|
|
9753
9775
|
return new ContainerType5({
|
|
9754
9776
|
cluster_definition: clusterDefinitionContainerTypeV1X10(false),
|
|
9755
|
-
distributed_validators: new
|
|
9777
|
+
distributed_validators: new ListCompositeType5(dvContainerTypeV1X10, 65536)
|
|
9756
9778
|
});
|
|
9757
9779
|
};
|
|
9758
9780
|
var hashClusterLockV1X10 = (cluster) => {
|
|
@@ -9805,6 +9827,175 @@ var hashClusterLockV1X10 = (cluster) => {
|
|
|
9805
9827
|
};
|
|
9806
9828
|
var verifyDVV1X10 = verifyDVV1X8;
|
|
9807
9829
|
|
|
9830
|
+
// src/verification/v1.11.0.ts
|
|
9831
|
+
import {
|
|
9832
|
+
UintNumberType as UintNumberType6
|
|
9833
|
+
} from "@chainsafe/ssz/lib/type/uint.js";
|
|
9834
|
+
import {
|
|
9835
|
+
ByteListType as ByteListType6,
|
|
9836
|
+
ByteVectorType as ByteVectorType6,
|
|
9837
|
+
ContainerType as ContainerType6,
|
|
9838
|
+
ListBasicType as ListBasicType3,
|
|
9839
|
+
ListCompositeType as ListCompositeType6,
|
|
9840
|
+
fromHexString as fromHexString5,
|
|
9841
|
+
BooleanType as BooleanType2
|
|
9842
|
+
} from "@chainsafe/ssz";
|
|
9843
|
+
var splitK1SignatureList = (signature) => {
|
|
9844
|
+
const bytes = fromHexString5(signature);
|
|
9845
|
+
if (bytes.length === 0) return [];
|
|
9846
|
+
if (bytes.length % 65 !== 0) {
|
|
9847
|
+
throw new Error("Signature length must be a multiple of 65 bytes");
|
|
9848
|
+
}
|
|
9849
|
+
const chunks = [];
|
|
9850
|
+
for (let i = 0; i < bytes.length; i += 65) {
|
|
9851
|
+
chunks.push(bytes.slice(i, i + 65));
|
|
9852
|
+
}
|
|
9853
|
+
return chunks;
|
|
9854
|
+
};
|
|
9855
|
+
var clusterDefinitionContainerTypeV1X11 = (configOnly) => {
|
|
9856
|
+
let returnedContainerType = {
|
|
9857
|
+
uuid: new ByteListType6(64),
|
|
9858
|
+
name: new ByteListType6(256),
|
|
9859
|
+
version: new ByteListType6(16),
|
|
9860
|
+
timestamp: new ByteListType6(32),
|
|
9861
|
+
num_validators: new UintNumberType6(8),
|
|
9862
|
+
threshold: new UintNumberType6(8),
|
|
9863
|
+
dkg_algorithm: new ByteListType6(32),
|
|
9864
|
+
fork_version: new ByteVectorType6(4),
|
|
9865
|
+
operators: new ListCompositeType6(
|
|
9866
|
+
newOperatorContainerTypeV1X11(configOnly),
|
|
9867
|
+
256
|
|
9868
|
+
),
|
|
9869
|
+
creator: newCreatorContainerTypeV1X11(configOnly),
|
|
9870
|
+
validators: new ListCompositeType6(validatorsContainerType, 65536),
|
|
9871
|
+
deposit_amounts: new ListBasicType3(
|
|
9872
|
+
new UintNumberType6(8),
|
|
9873
|
+
256
|
|
9874
|
+
),
|
|
9875
|
+
consensus_protocol: new ByteListType6(256),
|
|
9876
|
+
target_gas_limit: new UintNumberType6(8),
|
|
9877
|
+
compounding: new BooleanType2()
|
|
9878
|
+
};
|
|
9879
|
+
if (!configOnly) {
|
|
9880
|
+
returnedContainerType = __spreadProps(__spreadValues({}, returnedContainerType), {
|
|
9881
|
+
config_hash: new ByteVectorType6(32)
|
|
9882
|
+
});
|
|
9883
|
+
}
|
|
9884
|
+
return new ContainerType6(returnedContainerType);
|
|
9885
|
+
};
|
|
9886
|
+
var hashClusterDefinitionV1X11 = (cluster, configOnly) => {
|
|
9887
|
+
const definitionType = clusterDefinitionContainerTypeV1X11(configOnly);
|
|
9888
|
+
const val = definitionType.defaultValue();
|
|
9889
|
+
val.uuid = strToUint8Array(cluster.uuid);
|
|
9890
|
+
val.name = strToUint8Array(cluster.name);
|
|
9891
|
+
val.version = strToUint8Array(cluster.version);
|
|
9892
|
+
val.timestamp = strToUint8Array(cluster.timestamp);
|
|
9893
|
+
val.num_validators = cluster.num_validators;
|
|
9894
|
+
val.threshold = cluster.threshold;
|
|
9895
|
+
val.dkg_algorithm = strToUint8Array(cluster.dkg_algorithm);
|
|
9896
|
+
val.fork_version = fromHexString5(cluster.fork_version);
|
|
9897
|
+
val.operators = cluster.operators.map((operator) => {
|
|
9898
|
+
return configOnly ? { address: fromHexString5(operator.address) } : {
|
|
9899
|
+
address: fromHexString5(operator.address),
|
|
9900
|
+
enr: strToUint8Array(operator.enr),
|
|
9901
|
+
config_signature: splitK1SignatureList(
|
|
9902
|
+
operator.config_signature
|
|
9903
|
+
),
|
|
9904
|
+
enr_signature: splitK1SignatureList(operator.enr_signature)
|
|
9905
|
+
};
|
|
9906
|
+
});
|
|
9907
|
+
val.creator = configOnly ? { address: fromHexString5(cluster.creator.address) } : {
|
|
9908
|
+
address: fromHexString5(cluster.creator.address),
|
|
9909
|
+
config_signature: splitK1SignatureList(
|
|
9910
|
+
cluster.creator.config_signature
|
|
9911
|
+
)
|
|
9912
|
+
};
|
|
9913
|
+
val.validators = cluster.validators.map((validator) => {
|
|
9914
|
+
return {
|
|
9915
|
+
fee_recipient_address: fromHexString5(validator.fee_recipient_address),
|
|
9916
|
+
withdrawal_address: fromHexString5(validator.withdrawal_address)
|
|
9917
|
+
};
|
|
9918
|
+
});
|
|
9919
|
+
if (cluster.deposit_amounts) {
|
|
9920
|
+
val.deposit_amounts = cluster.deposit_amounts.map((amount) => {
|
|
9921
|
+
return parseInt(amount);
|
|
9922
|
+
});
|
|
9923
|
+
}
|
|
9924
|
+
if (cluster.consensus_protocol) {
|
|
9925
|
+
val.consensus_protocol = strToUint8Array(cluster.consensus_protocol);
|
|
9926
|
+
}
|
|
9927
|
+
if (cluster.target_gas_limit) {
|
|
9928
|
+
val.target_gas_limit = cluster.target_gas_limit;
|
|
9929
|
+
}
|
|
9930
|
+
if (cluster.compounding) {
|
|
9931
|
+
val.compounding = cluster.compounding;
|
|
9932
|
+
}
|
|
9933
|
+
if (!configOnly) {
|
|
9934
|
+
val.config_hash = fromHexString5(cluster.config_hash);
|
|
9935
|
+
}
|
|
9936
|
+
return val;
|
|
9937
|
+
};
|
|
9938
|
+
var dvContainerTypeV1X11 = new ContainerType6({
|
|
9939
|
+
distributed_public_key: new ByteVectorType6(48),
|
|
9940
|
+
public_shares: new ListCompositeType6(new ByteVectorType6(48), 256),
|
|
9941
|
+
partial_deposit_data: new ListCompositeType6(depositDataContainer, 256),
|
|
9942
|
+
builder_registration: builderRegistrationContainer
|
|
9943
|
+
});
|
|
9944
|
+
var clusterLockContainerTypeV1X11 = () => {
|
|
9945
|
+
return new ContainerType6({
|
|
9946
|
+
cluster_definition: clusterDefinitionContainerTypeV1X11(false),
|
|
9947
|
+
distributed_validators: new ListCompositeType6(dvContainerTypeV1X11, 65536)
|
|
9948
|
+
});
|
|
9949
|
+
};
|
|
9950
|
+
var hashClusterLockV1X11 = (cluster) => {
|
|
9951
|
+
const lockType = clusterLockContainerTypeV1X11();
|
|
9952
|
+
const val = lockType.defaultValue();
|
|
9953
|
+
val.cluster_definition = hashClusterDefinitionV1X11(
|
|
9954
|
+
cluster.cluster_definition,
|
|
9955
|
+
false
|
|
9956
|
+
);
|
|
9957
|
+
val.distributed_validators = cluster.distributed_validators.map(
|
|
9958
|
+
(dValidator) => {
|
|
9959
|
+
var _a6, _b2, _c, _d, _e;
|
|
9960
|
+
return {
|
|
9961
|
+
distributed_public_key: fromHexString5(
|
|
9962
|
+
dValidator.distributed_public_key
|
|
9963
|
+
),
|
|
9964
|
+
public_shares: dValidator.public_shares.map(
|
|
9965
|
+
(publicShare) => fromHexString5(publicShare)
|
|
9966
|
+
),
|
|
9967
|
+
partial_deposit_data: dValidator.partial_deposit_data.map((depositData) => {
|
|
9968
|
+
return {
|
|
9969
|
+
pubkey: fromHexString5(depositData.pubkey),
|
|
9970
|
+
withdrawal_credentials: fromHexString5(
|
|
9971
|
+
depositData.withdrawal_credentials
|
|
9972
|
+
),
|
|
9973
|
+
amount: parseInt(depositData.amount),
|
|
9974
|
+
signature: fromHexString5(depositData.signature)
|
|
9975
|
+
};
|
|
9976
|
+
}),
|
|
9977
|
+
builder_registration: {
|
|
9978
|
+
message: {
|
|
9979
|
+
fee_recipient: fromHexString5(
|
|
9980
|
+
(_a6 = dValidator.builder_registration) == null ? void 0 : _a6.message.fee_recipient
|
|
9981
|
+
),
|
|
9982
|
+
gas_limit: (_b2 = dValidator.builder_registration) == null ? void 0 : _b2.message.gas_limit,
|
|
9983
|
+
timestamp: (_c = dValidator.builder_registration) == null ? void 0 : _c.message.timestamp,
|
|
9984
|
+
pubkey: fromHexString5(
|
|
9985
|
+
(_d = dValidator.builder_registration) == null ? void 0 : _d.message.pubkey
|
|
9986
|
+
)
|
|
9987
|
+
},
|
|
9988
|
+
signature: fromHexString5(
|
|
9989
|
+
(_e = dValidator.builder_registration) == null ? void 0 : _e.signature
|
|
9990
|
+
)
|
|
9991
|
+
}
|
|
9992
|
+
};
|
|
9993
|
+
}
|
|
9994
|
+
);
|
|
9995
|
+
return "0x" + Buffer.from(lockType.hashTreeRoot(val).buffer).toString("hex");
|
|
9996
|
+
};
|
|
9997
|
+
var verifyDVV1X11 = verifyDVV1X8;
|
|
9998
|
+
|
|
9808
9999
|
// src/verification/common.ts
|
|
9809
10000
|
var clusterConfigOrDefinitionHash = (cluster, configOnly) => {
|
|
9810
10001
|
let definitionType, val;
|
|
@@ -9829,6 +10020,11 @@ var clusterConfigOrDefinitionHash = (cluster, configOnly) => {
|
|
|
9829
10020
|
const x = "0x" + Buffer.from(definitionType.hashTreeRoot(val).buffer).toString("hex");
|
|
9830
10021
|
return x;
|
|
9831
10022
|
}
|
|
10023
|
+
if (semver.eq(cluster.version, "v1.11.0")) {
|
|
10024
|
+
definitionType = clusterDefinitionContainerTypeV1X11(configOnly);
|
|
10025
|
+
val = hashClusterDefinitionV1X11(cluster, configOnly);
|
|
10026
|
+
return "0x" + Buffer.from(definitionType.hashTreeRoot(val).buffer).toString("hex");
|
|
10027
|
+
}
|
|
9832
10028
|
throw new Error("unsupported version");
|
|
9833
10029
|
};
|
|
9834
10030
|
var clusterLockHash = (clusterLock) => {
|
|
@@ -9854,6 +10050,9 @@ var clusterLockHash = (clusterLock) => {
|
|
|
9854
10050
|
if (semver.eq(clusterLock.cluster_definition.version, "v1.10.0")) {
|
|
9855
10051
|
return hashClusterLockV1X10(clusterLock);
|
|
9856
10052
|
}
|
|
10053
|
+
if (semver.eq(clusterLock.cluster_definition.version, "v1.11.0")) {
|
|
10054
|
+
return hashClusterLockV1X11(clusterLock);
|
|
10055
|
+
}
|
|
9857
10056
|
throw new Error("unsupported version");
|
|
9858
10057
|
};
|
|
9859
10058
|
var validatePOSTConfigHashSigner = (address, signature, configHash, chainId, safeRpcUrl) => __async(null, null, function* () {
|
|
@@ -9953,8 +10152,8 @@ var computeSigningRoot = (sszObjectRoot, domain) => {
|
|
|
9953
10152
|
};
|
|
9954
10153
|
var computeDepositMsgRoot = (msg) => {
|
|
9955
10154
|
const depositMsgVal = depositMessageType.defaultValue();
|
|
9956
|
-
depositMsgVal.pubkey =
|
|
9957
|
-
depositMsgVal.withdrawal_credentials =
|
|
10155
|
+
depositMsgVal.pubkey = fromHexString6(msg.pubkey);
|
|
10156
|
+
depositMsgVal.withdrawal_credentials = fromHexString6(
|
|
9958
10157
|
msg.withdrawal_credentials
|
|
9959
10158
|
);
|
|
9960
10159
|
depositMsgVal.amount = parseInt(msg.amount);
|
|
@@ -9968,16 +10167,16 @@ var computeForkDataRoot = (currentVersion, genesisValidatorsRoot) => {
|
|
|
9968
10167
|
};
|
|
9969
10168
|
var computebuilderRegistrationMsgRoot = (msg) => {
|
|
9970
10169
|
const builderRegistrationMsgVal = builderRegistrationMessageType.defaultValue();
|
|
9971
|
-
builderRegistrationMsgVal.fee_recipient =
|
|
10170
|
+
builderRegistrationMsgVal.fee_recipient = fromHexString6(msg.fee_recipient);
|
|
9972
10171
|
builderRegistrationMsgVal.gas_limit = msg.gas_limit;
|
|
9973
10172
|
builderRegistrationMsgVal.timestamp = msg.timestamp;
|
|
9974
|
-
builderRegistrationMsgVal.pubkey =
|
|
10173
|
+
builderRegistrationMsgVal.pubkey = fromHexString6(msg.pubkey);
|
|
9975
10174
|
return Buffer.from(
|
|
9976
10175
|
builderRegistrationMessageType.hashTreeRoot(builderRegistrationMsgVal).buffer
|
|
9977
10176
|
);
|
|
9978
10177
|
};
|
|
9979
|
-
var computeDomain = (domainType, lockForkVersion, genesisValidatorsRoot =
|
|
9980
|
-
const forkVersion =
|
|
10178
|
+
var computeDomain = (domainType, lockForkVersion, genesisValidatorsRoot = fromHexString6(GENESIS_VALIDATOR_ROOT)) => {
|
|
10179
|
+
const forkVersion = fromHexString6(
|
|
9981
10180
|
lockForkVersion.substring(2, lockForkVersion.length)
|
|
9982
10181
|
);
|
|
9983
10182
|
const forkDataRoot = computeForkDataRoot(forkVersion, genesisValidatorsRoot);
|
|
@@ -9986,10 +10185,10 @@ var computeDomain = (domainType, lockForkVersion, genesisValidatorsRoot = fromHe
|
|
|
9986
10185
|
domain.set(forkDataRoot.subarray(0, 28), 4);
|
|
9987
10186
|
return domain;
|
|
9988
10187
|
};
|
|
9989
|
-
var depositDomainForFork = (forkVersion) => computeDomain(
|
|
9990
|
-
var builderDomainForFork = (forkVersion) => computeDomain(
|
|
10188
|
+
var depositDomainForFork = (forkVersion) => computeDomain(fromHexString6(DOMAIN_DEPOSIT), forkVersion);
|
|
10189
|
+
var builderDomainForFork = (forkVersion) => computeDomain(fromHexString6(DOMAIN_APPLICATION_BUILDER), forkVersion);
|
|
9991
10190
|
var validateDepositDataStructure = (distributedPublicKey, depositData, withdrawalAddress, forkVersion, compounding, precomputedDepositDomain) => {
|
|
9992
|
-
const depositDomain = precomputedDepositDomain != null ? precomputedDepositDomain : computeDomain(
|
|
10191
|
+
const depositDomain = precomputedDepositDomain != null ? precomputedDepositDomain : computeDomain(fromHexString6(DOMAIN_DEPOSIT), forkVersion);
|
|
9993
10192
|
const withdrawalPrefix = compounding ? "0x02" : "0x01";
|
|
9994
10193
|
const expectedWithdrawalCredentials = withdrawalPrefix + "0".repeat(22) + withdrawalAddress.toLowerCase().slice(2);
|
|
9995
10194
|
if (expectedWithdrawalCredentials !== depositData.withdrawal_credentials) {
|
|
@@ -10016,9 +10215,9 @@ var depositBlsCheck = (distributedPublicKey, depositData, withdrawalAddress, for
|
|
|
10016
10215
|
);
|
|
10017
10216
|
if (!valid || !depositData.signature || !depositData.pubkey) return null;
|
|
10018
10217
|
return {
|
|
10019
|
-
pubkey:
|
|
10218
|
+
pubkey: fromHexString6(depositData.pubkey),
|
|
10020
10219
|
message: message2,
|
|
10021
|
-
signature:
|
|
10220
|
+
signature: fromHexString6(depositData.signature)
|
|
10022
10221
|
};
|
|
10023
10222
|
};
|
|
10024
10223
|
var verifyDepositData = (distributedPublicKey, depositData, withdrawalAddress, forkVersion, compounding) => {
|
|
@@ -10033,15 +10232,15 @@ var verifyDepositData = (distributedPublicKey, depositData, withdrawalAddress, f
|
|
|
10033
10232
|
return { isValidDepositData: false, depositDataMsg: message2 };
|
|
10034
10233
|
}
|
|
10035
10234
|
const isValidDepositData = blsVerify(
|
|
10036
|
-
|
|
10235
|
+
fromHexString6(depositData.pubkey),
|
|
10037
10236
|
message2,
|
|
10038
|
-
|
|
10237
|
+
fromHexString6(depositData.signature)
|
|
10039
10238
|
);
|
|
10040
10239
|
return { isValidDepositData, depositDataMsg: message2 };
|
|
10041
10240
|
};
|
|
10042
10241
|
var verifyBuilderRegistration = (validator, feeRecipientAddress, forkVersion, precomputedBuilderDomain) => {
|
|
10043
10242
|
var _a6;
|
|
10044
|
-
const builderDomain = precomputedBuilderDomain != null ? precomputedBuilderDomain : computeDomain(
|
|
10243
|
+
const builderDomain = precomputedBuilderDomain != null ? precomputedBuilderDomain : computeDomain(fromHexString6(DOMAIN_APPLICATION_BUILDER), forkVersion);
|
|
10045
10244
|
if (validator.distributed_public_key !== ((_a6 = validator.builder_registration) == null ? void 0 : _a6.message.pubkey)) {
|
|
10046
10245
|
return {
|
|
10047
10246
|
isValidBuilderRegistration: false,
|
|
@@ -10077,9 +10276,9 @@ var builderBlsCheck = (validator, feeRecipientAddress, forkVersion, precomputedB
|
|
|
10077
10276
|
const sig = (_a6 = validator.builder_registration) == null ? void 0 : _a6.signature;
|
|
10078
10277
|
if (!isValidBuilderRegistration || !sig) return null;
|
|
10079
10278
|
return {
|
|
10080
|
-
pubkey:
|
|
10279
|
+
pubkey: fromHexString6(validator.distributed_public_key),
|
|
10081
10280
|
message: builderRegistrationMsg,
|
|
10082
|
-
signature:
|
|
10281
|
+
signature: fromHexString6(sig)
|
|
10083
10282
|
};
|
|
10084
10283
|
};
|
|
10085
10284
|
var verifyNodeSignatures = (clusterLock) => {
|
|
@@ -10121,6 +10320,9 @@ var verifyLockData = (clusterLock) => __async(null, null, function* () {
|
|
|
10121
10320
|
if (semver.eq(clusterLock.cluster_definition.version, "v1.10.0")) {
|
|
10122
10321
|
return yield verifyDVV1X10(clusterLock);
|
|
10123
10322
|
}
|
|
10323
|
+
if (semver.eq(clusterLock.cluster_definition.version, "v1.11.0")) {
|
|
10324
|
+
return yield verifyDVV1X11(clusterLock);
|
|
10325
|
+
}
|
|
10124
10326
|
return false;
|
|
10125
10327
|
});
|
|
10126
10328
|
var hasUniqueDistributedKeys = (clusterLock) => {
|
|
@@ -10242,4 +10444,4 @@ export {
|
|
|
10242
10444
|
@scure/base/index.js:
|
|
10243
10445
|
(*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
10244
10446
|
*/
|
|
10245
|
-
//# sourceMappingURL=chunk-
|
|
10447
|
+
//# sourceMappingURL=chunk-EITEAAK3.js.map
|