@xyo-network/chain-services 1.18.1 → 1.18.4
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/neutral/AccountBalance/accountBalanceServiceFromArchivist.d.ts.map +1 -1
- package/dist/neutral/NetworkStakeStepReward/BaseNetworkStakeStepRewardService.d.ts +14 -14
- package/dist/neutral/NetworkStakeStepReward/BaseNetworkStakeStepRewardService.d.ts.map +1 -1
- package/dist/neutral/Schemas/BaseSchemasService.d.ts.map +1 -1
- package/dist/neutral/StakeIntent/XyoStakeIntentService.d.ts.map +1 -1
- package/dist/neutral/implementation/index.d.ts +0 -1
- package/dist/neutral/implementation/index.d.ts.map +1 -1
- package/dist/neutral/index.d.ts +0 -1
- package/dist/neutral/index.d.ts.map +1 -1
- package/dist/neutral/index.mjs +91 -290
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/simple/block/runner/SimpleBlockRunner.d.ts +4 -2
- package/dist/neutral/simple/block/runner/SimpleBlockRunner.d.ts.map +1 -1
- package/package.json +28 -28
- package/src/AccountBalance/accountBalanceServiceFromArchivist.ts +7 -3
- package/src/BlockReward/EvmBlockRewardViewer.ts +2 -2
- package/src/Election/BaseElectionService.ts +1 -1
- package/src/NetworkStakeStepReward/BaseNetworkStakeStepRewardService.ts +14 -13
- package/src/PendingTransactions/BasePendingTransactions.ts +3 -3
- package/src/Schemas/BaseSchemasService.ts +3 -3
- package/src/StakeIntent/XyoStakeIntentService.ts +19 -21
- package/src/implementation/index.ts +0 -1
- package/src/index.ts +0 -1
- package/src/simple/block/runner/SimpleBlockRunner.ts +25 -29
- package/dist/neutral/ChainService/Evm/Evm.d.ts +0 -38
- package/dist/neutral/ChainService/Evm/Evm.d.ts.map +0 -1
- package/dist/neutral/ChainService/Evm/index.d.ts +0 -2
- package/dist/neutral/ChainService/Evm/index.d.ts.map +0 -1
- package/dist/neutral/ChainService/Memory/Memory.d.ts +0 -37
- package/dist/neutral/ChainService/Memory/Memory.d.ts.map +0 -1
- package/dist/neutral/ChainService/Memory/index.d.ts +0 -2
- package/dist/neutral/ChainService/Memory/index.d.ts.map +0 -1
- package/dist/neutral/ChainService/index.d.ts +0 -3
- package/dist/neutral/ChainService/index.d.ts.map +0 -1
- package/dist/neutral/implementation/chain/evm.d.ts +0 -6
- package/dist/neutral/implementation/chain/evm.d.ts.map +0 -1
- package/dist/neutral/implementation/chain/index.d.ts +0 -5
- package/dist/neutral/implementation/chain/index.d.ts.map +0 -1
- package/src/ChainService/Evm/Evm.ts +0 -106
- package/src/ChainService/Evm/index.ts +0 -1
- package/src/ChainService/Memory/Memory.ts +0 -105
- package/src/ChainService/Memory/index.ts +0 -1
- package/src/ChainService/index.ts +0 -2
- package/src/implementation/chain/evm.ts +0 -38
- package/src/implementation/chain/index.ts +0 -43
|
@@ -17,12 +17,12 @@ export declare const XYO_PRODUCER_REDECLARATION_DURATION = 10000;
|
|
|
17
17
|
* their intent to produce blocks
|
|
18
18
|
*/
|
|
19
19
|
export declare const XYO_PRODUCER_REDECLARATION_WINDOW = 500;
|
|
20
|
-
export
|
|
20
|
+
export interface SimpleBlockRunnerParams extends CreatableProviderParams {
|
|
21
21
|
account: AccountInstance;
|
|
22
22
|
rejectedTransactionsArchivist?: ArchivistInstance;
|
|
23
23
|
rewardAddress: Address;
|
|
24
24
|
validateHydratedBlockState?: HydratedBlockStateValidationFunction;
|
|
25
|
-
}
|
|
25
|
+
}
|
|
26
26
|
export declare class SimpleBlockRunner extends AbstractCreatableProvider<SimpleBlockRunnerParams> implements BlockRunner {
|
|
27
27
|
static readonly defaultMoniker: "BlockRunner";
|
|
28
28
|
static readonly dependencies: ("AccountBalanceViewer" | "BlockRewardViewer" | "MempoolViewer" | "BlockValidationViewer" | "MempoolRunner" | "TimeSyncViewer")[];
|
|
@@ -36,6 +36,7 @@ export declare class SimpleBlockRunner extends AbstractCreatableProvider<SimpleB
|
|
|
36
36
|
private _address?;
|
|
37
37
|
private _blockRewardViewer?;
|
|
38
38
|
private _blockValidationViewer?;
|
|
39
|
+
private _chainId?;
|
|
39
40
|
private _mempoolRunner?;
|
|
40
41
|
private _mempoolViewer?;
|
|
41
42
|
private _rewardAddress?;
|
|
@@ -63,6 +64,7 @@ export declare class SimpleBlockRunner extends AbstractCreatableProvider<SimpleB
|
|
|
63
64
|
};
|
|
64
65
|
protected get blockRewardViewer(): BlockRewardViewer;
|
|
65
66
|
protected get blockValidationViewer(): BlockValidationViewer;
|
|
67
|
+
protected get chainId(): import("@xylabs/sdk-js").BrandedHex | undefined;
|
|
66
68
|
protected get mempoolRunner(): MempoolRunner;
|
|
67
69
|
protected get mempoolViewer(): MempoolViewer;
|
|
68
70
|
protected get rejectedTransactionsArchivist(): ArchivistInstance<import("@xyo-network/archivist-model").ArchivistParams<import("@xyo-network/module-model").AnyConfigSchema<import("@xyo-network/archivist-model").ArchivistConfig>>, import("@xyo-network/archivist-model").ArchivistModuleEventData, import("@xyo-network/payload-model").Payload>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleBlockRunner.d.ts","sourceRoot":"","sources":["../../../../../src/simple/block/runner/SimpleBlockRunner.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,
|
|
1
|
+
{"version":3,"file":"SimpleBlockRunner.d.ts","sourceRoot":"","sources":["../../../../../src/simple/block/runner/SimpleBlockRunner.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAAiD,UAAU,EACnE,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAChE,OAAO,EACL,kBAAkB,EACnB,MAAM,4BAA4B,CAAA;AAGnC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EACL,yBAAyB,EAAE,oBAAoB,EAAkF,iBAAiB,EAC3G,iBAAiB,EAA4B,WAAW,EAAsB,qB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AAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA4EtG,cAAc;YAyBd,mBAAmB;IAIjC;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;CAU1B"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@xyo-network/chain-services",
|
|
4
|
-
"version": "1.18.
|
|
4
|
+
"version": "1.18.4",
|
|
5
5
|
"description": "XYO Layer One SDK Services",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -40,41 +40,41 @@
|
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@opentelemetry/api": "^1.9.0",
|
|
43
|
-
"@xylabs/sdk-js": "~5.0.
|
|
44
|
-
"@xyo-network/account-model": "~5.2.
|
|
45
|
-
"@xyo-network/archivist-memory": "~5.2.
|
|
46
|
-
"@xyo-network/archivist-model": "~5.2.
|
|
47
|
-
"@xyo-network/boundwitness-model": "~5.2.
|
|
48
|
-
"@xyo-network/boundwitness-validator": "~5.2.
|
|
49
|
-
"@xyo-network/boundwitness-wrapper": "~5.2.
|
|
50
|
-
"@xyo-network/chain-analyze": "~1.18.
|
|
51
|
-
"@xyo-network/chain-modules": "~1.18.
|
|
52
|
-
"@xyo-network/chain-protocol": "~1.18.
|
|
53
|
-
"@xyo-network/chain-utils": "~1.18.
|
|
54
|
-
"@xyo-network/payload-builder": "~5.2.
|
|
55
|
-
"@xyo-network/payload-model": "~5.2.
|
|
56
|
-
"@xyo-network/typechain": "~4.
|
|
57
|
-
"@xyo-network/xl1-sdk": "~1.
|
|
43
|
+
"@xylabs/sdk-js": "~5.0.64",
|
|
44
|
+
"@xyo-network/account-model": "~5.2.25",
|
|
45
|
+
"@xyo-network/archivist-memory": "~5.2.25",
|
|
46
|
+
"@xyo-network/archivist-model": "~5.2.25",
|
|
47
|
+
"@xyo-network/boundwitness-model": "~5.2.25",
|
|
48
|
+
"@xyo-network/boundwitness-validator": "~5.2.25",
|
|
49
|
+
"@xyo-network/boundwitness-wrapper": "~5.2.25",
|
|
50
|
+
"@xyo-network/chain-analyze": "~1.18.4",
|
|
51
|
+
"@xyo-network/chain-modules": "~1.18.4",
|
|
52
|
+
"@xyo-network/chain-protocol": "~1.18.4",
|
|
53
|
+
"@xyo-network/chain-utils": "~1.18.4",
|
|
54
|
+
"@xyo-network/payload-builder": "~5.2.25",
|
|
55
|
+
"@xyo-network/payload-model": "~5.2.25",
|
|
56
|
+
"@xyo-network/typechain": "~4.1.1",
|
|
57
|
+
"@xyo-network/xl1-sdk": "~1.19.4",
|
|
58
58
|
"async-mutex": "~0.5.0",
|
|
59
59
|
"ethers": "^6.16.0",
|
|
60
|
-
"lru-cache": "^11.2.
|
|
60
|
+
"lru-cache": "^11.2.5"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@types/node": "~25.0.
|
|
64
|
-
"@xylabs/sdk-js": "~5.0.
|
|
65
|
-
"@xylabs/ts-scripts-yarn3": "~7.2
|
|
66
|
-
"@xylabs/tsconfig": "~7.2
|
|
67
|
-
"@xylabs/vitest-extended": "~5.0.
|
|
68
|
-
"@xyo-network/account": "~5.2.
|
|
69
|
-
"@xyo-network/account-model": "~5.2.
|
|
70
|
-
"@xyo-network/chain-validation": "~1.18.
|
|
71
|
-
"@xyo-network/wallet": "~5.2.
|
|
72
|
-
"@xyo-network/wallet-model": "~5.2.
|
|
63
|
+
"@types/node": "~25.0.10",
|
|
64
|
+
"@xylabs/sdk-js": "~5.0.64",
|
|
65
|
+
"@xylabs/ts-scripts-yarn3": "~7.3.2",
|
|
66
|
+
"@xylabs/tsconfig": "~7.3.2",
|
|
67
|
+
"@xylabs/vitest-extended": "~5.0.64",
|
|
68
|
+
"@xyo-network/account": "~5.2.25",
|
|
69
|
+
"@xyo-network/account-model": "~5.2.25",
|
|
70
|
+
"@xyo-network/chain-validation": "~1.18.4",
|
|
71
|
+
"@xyo-network/wallet": "~5.2.25",
|
|
72
|
+
"@xyo-network/wallet-model": "~5.2.25",
|
|
73
73
|
"cosmiconfig": "^9.0.0",
|
|
74
74
|
"eslint": "^9.39.2",
|
|
75
75
|
"tslib": "~2.8.1",
|
|
76
76
|
"typescript": "~5.9.3",
|
|
77
|
-
"vitest": "~4.0.
|
|
77
|
+
"vitest": "~4.0.18",
|
|
78
78
|
"vitest-mock-extended": "~3.1.0",
|
|
79
79
|
"web3-types": "~1.10.0"
|
|
80
80
|
},
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { Hash } from '@xylabs/sdk-js'
|
|
2
2
|
import { assertEx } from '@xylabs/sdk-js'
|
|
3
3
|
import type { ReadWriteArchivist } from '@xyo-network/archivist-model'
|
|
4
|
-
import type {
|
|
4
|
+
import type {
|
|
5
|
+
Payload, WithHashMeta, WithStorageMeta,
|
|
6
|
+
} from '@xyo-network/payload-model'
|
|
5
7
|
import type {
|
|
6
8
|
AccountBalanceViewer, BalancesStepSummary, ChainId,
|
|
7
9
|
CreatableProviderContext, SimpleAccountBalanceViewerParams, TransfersStepSummary,
|
|
@@ -18,14 +20,14 @@ export const accountBalancesViewerFromArchivist = async (
|
|
|
18
20
|
chainId: ChainId,
|
|
19
21
|
archivist: ReadWriteArchivist<WithStorageMeta<Payload>>,
|
|
20
22
|
): Promise<AccountBalanceViewer> => {
|
|
21
|
-
const summaryMap = new LruCacheMap<string, BalancesStepSummary
|
|
23
|
+
const summaryMap = new LruCacheMap<string, WithHashMeta<BalancesStepSummary>>({
|
|
22
24
|
max: 100_000,
|
|
23
25
|
allowStale: true,
|
|
24
26
|
noDisposeOnSet: false,
|
|
25
27
|
updateAgeOnGet: true,
|
|
26
28
|
})
|
|
27
29
|
|
|
28
|
-
const transferSummaryMap = new LruCacheMap<string, TransfersStepSummary
|
|
30
|
+
const transferSummaryMap = new LruCacheMap<string, WithHashMeta<TransfersStepSummary>>({
|
|
29
31
|
max: 100_000,
|
|
30
32
|
allowStale: true,
|
|
31
33
|
noDisposeOnSet: false,
|
|
@@ -47,6 +49,7 @@ export const accountBalancesViewerFromArchivist = async (
|
|
|
47
49
|
summaryMap,
|
|
48
50
|
head: headFunc,
|
|
49
51
|
singletons: context.singletons,
|
|
52
|
+
caches: context.caches,
|
|
50
53
|
},
|
|
51
54
|
transfersSummaryContext: {
|
|
52
55
|
chainId,
|
|
@@ -55,6 +58,7 @@ export const accountBalancesViewerFromArchivist = async (
|
|
|
55
58
|
summaryMap: transferSummaryMap,
|
|
56
59
|
head: headFunc,
|
|
57
60
|
singletons: context.singletons,
|
|
61
|
+
caches: context.caches,
|
|
58
62
|
},
|
|
59
63
|
} satisfies SimpleAccountBalanceViewerParams)
|
|
60
64
|
return service
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
AbstractCreatable,
|
|
3
3
|
assertEx, creatable, CreatableParams, toEthAddress,
|
|
4
4
|
} from '@xylabs/sdk-js'
|
|
5
|
-
import {
|
|
5
|
+
import { IXyoChainRewards__factory } from '@xyo-network/typechain'
|
|
6
6
|
import {
|
|
7
7
|
asAttoXL1, AttoXL1, BlockRewardViewer,
|
|
8
8
|
BlockRewardViewerMoniker,
|
|
@@ -37,7 +37,7 @@ export class EvmBlockRewardViewer extends AbstractCreatable<EvmBlockRewardViewer
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
async allowedRewardForBlock(blockNumber: XL1BlockNumber): Promise<AttoXL1> {
|
|
40
|
-
const contract =
|
|
40
|
+
const contract = IXyoChainRewards__factory.connect(toEthAddress(this.contractAddress), this.provider)
|
|
41
41
|
return asAttoXL1(await contract.calcBlockReward(blockNumber))
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -43,7 +43,7 @@ export class BaseElectionService extends AbstractCreatableProvider<BaseElectionS
|
|
|
43
43
|
const candidates = await this.stakeIntentService.getDeclaredCandidatesForBlock(nextBlock, 'producer')
|
|
44
44
|
const previousBlockHash = current._hash
|
|
45
45
|
return this.generateCreatorCommittee(candidates, previousBlockHash)
|
|
46
|
-
})
|
|
46
|
+
}, { timeBudgetLimit: 200 })
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
protected generateCreatorCommittee(candidates: Address[], previousBlockHash: Hash, maxSize = 3): Address[] {
|
|
@@ -2,6 +2,7 @@ import { Address, Promisable } from '@xylabs/sdk-js'
|
|
|
2
2
|
import { ReadArchivist } from '@xyo-network/archivist-model'
|
|
3
3
|
import {
|
|
4
4
|
AbstractCreatableProvider,
|
|
5
|
+
AttoXL1,
|
|
5
6
|
creatableProvider,
|
|
6
7
|
EventingChainBlockNumberIteratorService, NetworkStakeStepRewardService, NetworkStakeStepRewardViewerMoniker,
|
|
7
8
|
StepIdentity,
|
|
@@ -25,11 +26,11 @@ export class BaseNetworkStakeStepRewardService extends
|
|
|
25
26
|
static readonly monikers = [NetworkStakeStepRewardViewerMoniker]
|
|
26
27
|
override moniker = BaseNetworkStakeStepRewardService.defaultMoniker
|
|
27
28
|
|
|
28
|
-
networkStakeStepRewardAddressHistory(_address: Address): Promisable<Record<Address,
|
|
29
|
+
networkStakeStepRewardAddressHistory(_address: Address): Promisable<Record<Address, AttoXL1>> {
|
|
29
30
|
throw new Error('Method [networkStakeStepRewardAddressHistory] not implemented.')
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
networkStakeStepRewardAddressReward(_context: StepIdentity, _address: Address): Promisable<Record<Address,
|
|
33
|
+
networkStakeStepRewardAddressReward(_context: StepIdentity, _address: Address): Promisable<Record<Address, AttoXL1>> {
|
|
33
34
|
throw new Error('Method [networkStakeStepRewardAddressReward] not implemented.')
|
|
34
35
|
}
|
|
35
36
|
|
|
@@ -37,23 +38,23 @@ export class BaseNetworkStakeStepRewardService extends
|
|
|
37
38
|
throw new Error('Method [networkStakeStepRewardAddressShare] not implemented.')
|
|
38
39
|
}
|
|
39
40
|
|
|
40
|
-
networkStakeStepRewardClaimedByAddress(_address: Address): Promisable<
|
|
41
|
+
networkStakeStepRewardClaimedByAddress(_address: Address): Promisable<AttoXL1> {
|
|
41
42
|
throw new Error('Method [networkStakeStepRewardClaimedByAddress] not implemented.')
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
networkStakeStepRewardForPosition(_position: number, _range: [number, number]): Promisable<[
|
|
45
|
+
networkStakeStepRewardForPosition(_position: number, _range: [number, number]): Promisable<[AttoXL1, AttoXL1]> {
|
|
45
46
|
throw new Error('Method [networkStakeStepRewardForPosition] not implemented.')
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
networkStakeStepRewardForStep(_context: StepIdentity): Promisable<
|
|
49
|
+
networkStakeStepRewardForStep(_context: StepIdentity): Promisable<AttoXL1> {
|
|
49
50
|
throw new Error('Method [networkStakeStepRewardForStep] not implemented.')
|
|
50
51
|
}
|
|
51
52
|
|
|
52
|
-
networkStakeStepRewardForStepForPosition(_context: StepIdentity, _position: number): Promisable<[
|
|
53
|
+
networkStakeStepRewardForStepForPosition(_context: StepIdentity, _position: number): Promisable<[AttoXL1, AttoXL1]> {
|
|
53
54
|
throw new Error('Method [networkStakeStepRewardForStepForPosition] not implemented.')
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
networkStakeStepRewardPoolRewards(_context: StepIdentity): Promisable<Record<Address,
|
|
57
|
+
networkStakeStepRewardPoolRewards(_context: StepIdentity): Promisable<Record<Address, AttoXL1>> {
|
|
57
58
|
throw new Error('Method [networkStakeStepRewardPoolRewards] not implemented.')
|
|
58
59
|
}
|
|
59
60
|
|
|
@@ -65,11 +66,11 @@ export class BaseNetworkStakeStepRewardService extends
|
|
|
65
66
|
throw new Error('Method [networkStakeStepRewardPositionWeight] not implemented.')
|
|
66
67
|
}
|
|
67
68
|
|
|
68
|
-
networkStakeStepRewardPotentialPositionLoss(_context: StepIdentity, _position: number): Promisable<
|
|
69
|
+
networkStakeStepRewardPotentialPositionLoss(_context: StepIdentity, _position: number): Promisable<AttoXL1> {
|
|
69
70
|
throw new Error('Method [networkStakeStepRewardPotentialPositionLoss] not implemented.')
|
|
70
71
|
}
|
|
71
72
|
|
|
72
|
-
networkStakeStepRewardRandomizer(_context: StepIdentity): Promisable<
|
|
73
|
+
networkStakeStepRewardRandomizer(_context: StepIdentity): Promisable<AttoXL1> {
|
|
73
74
|
throw new Error('Method [networkStakeStepRewardRandomizer] not implemented.')
|
|
74
75
|
}
|
|
75
76
|
|
|
@@ -77,7 +78,7 @@ export class BaseNetworkStakeStepRewardService extends
|
|
|
77
78
|
throw new Error('Method [networkStakeStepRewardStakerCount] not implemented.')
|
|
78
79
|
}
|
|
79
80
|
|
|
80
|
-
networkStakeStepRewardUnclaimedByAddress(_address: Address): Promisable<
|
|
81
|
+
networkStakeStepRewardUnclaimedByAddress(_address: Address): Promisable<AttoXL1> {
|
|
81
82
|
throw new Error('Method [networkStakeStepRewardUnclaimedByAddress] not implemented.')
|
|
82
83
|
}
|
|
83
84
|
|
|
@@ -85,15 +86,15 @@ export class BaseNetworkStakeStepRewardService extends
|
|
|
85
86
|
throw new Error('Method [networkStakeStepRewardWeightForAddress] not implemented.')
|
|
86
87
|
}
|
|
87
88
|
|
|
88
|
-
networkStakeStepRewardsForPosition(_position: number, _range: [number, number]): Promisable<Record<StepIdentityString, [
|
|
89
|
+
networkStakeStepRewardsForPosition(_position: number, _range: [number, number]): Promisable<Record<StepIdentityString, [AttoXL1, AttoXL1]>> {
|
|
89
90
|
throw new Error('Method [networkStakeStepRewardsForPosition] not implemented.')
|
|
90
91
|
}
|
|
91
92
|
|
|
92
|
-
networkStakeStepRewardsForRange(_range: [number, number]): Promisable<
|
|
93
|
+
networkStakeStepRewardsForRange(_range: [number, number]): Promisable<AttoXL1> {
|
|
93
94
|
throw new Error('Method [networkStakeStepRewardsForRange] not implemented.')
|
|
94
95
|
}
|
|
95
96
|
|
|
96
|
-
networkStakeStepRewardsForStepLevel(_stepLevel: number, _range: [number, number]): Promisable<
|
|
97
|
+
networkStakeStepRewardsForStepLevel(_stepLevel: number, _range: [number, number]): Promisable<AttoXL1> {
|
|
97
98
|
throw new Error('Method [networkStakeStepRewardsForStepLevel] not implemented.')
|
|
98
99
|
}
|
|
99
100
|
}
|
|
@@ -224,7 +224,7 @@ export class BasePendingTransactionsService extends AbstractCreatableProvider<Ba
|
|
|
224
224
|
|
|
225
225
|
return foundPendingTransactions
|
|
226
226
|
}, BasePendingTransactionsService.MutexPriority.ReadTransactions)
|
|
227
|
-
})
|
|
227
|
+
}, { timeBudgetLimit: 100 })
|
|
228
228
|
}
|
|
229
229
|
|
|
230
230
|
private async cleanupWorker() {
|
|
@@ -275,7 +275,7 @@ export class BasePendingTransactionsService extends AbstractCreatableProvider<Ba
|
|
|
275
275
|
await this.pendingBundledTransactionsLocalArchivist.insert(bundledTransactions)
|
|
276
276
|
}
|
|
277
277
|
}, BasePendingTransactionsService.MutexPriority.InsertNewTransactions)
|
|
278
|
-
})
|
|
278
|
+
}, { timeBudgetLimit: 200 })
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
/**
|
|
@@ -359,7 +359,7 @@ export class BasePendingTransactionsService extends AbstractCreatableProvider<Ba
|
|
|
359
359
|
this.logger?.log(payload._hash)
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
|
-
})
|
|
362
|
+
}, { timeBudgetLimit: 200 })
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
365
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Hash
|
|
1
|
+
import { Hash } from '@xylabs/sdk-js'
|
|
2
2
|
import { Schema } from '@xyo-network/payload-model'
|
|
3
3
|
import {
|
|
4
4
|
AbstractCreatableProvider,
|
|
@@ -25,7 +25,7 @@ export class BaseSchemasService extends AbstractCreatableProvider<BaseSchemasSer
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
async schemas(head: Hash, schemas: Schema[]): Promise<Partial<Record<Schema, number>>> {
|
|
28
|
-
return await
|
|
28
|
+
return await this.spanAsync('schemas', async () => {
|
|
29
29
|
const [summary] = await schemasSummary(this.params.schemasStepSummaryContext)
|
|
30
30
|
const result: Record<Schema, number> = {}
|
|
31
31
|
for (const schema of schemas) {
|
|
@@ -33,6 +33,6 @@ export class BaseSchemasService extends AbstractCreatableProvider<BaseSchemasSer
|
|
|
33
33
|
result[schema] = count
|
|
34
34
|
}
|
|
35
35
|
return result
|
|
36
|
-
})
|
|
36
|
+
}, { timeBudgetLimit: 100 })
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -121,7 +121,7 @@ export class XyoStakeIntentService extends AbstractCreatableProvider<XyoStakeInt
|
|
|
121
121
|
const requiredMinimumStake = this.getRequiredMinimumStakeForIntent(intent)
|
|
122
122
|
const validCandidates = await this.filterToValidStake(candidates, this.chainStakeViewer, requiredMinimumStake)
|
|
123
123
|
return validCandidates
|
|
124
|
-
})
|
|
124
|
+
}, { timeBudgetLimit: 200 })
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
getRequiredMinimumStakeForIntent(intent: Intent): bigint {
|
|
@@ -225,32 +225,30 @@ export class XyoStakeIntentService extends AbstractCreatableProvider<XyoStakeInt
|
|
|
225
225
|
return await this.spanAsync('updateIndex', async () => {
|
|
226
226
|
const currentHead = (await this.blockViewer.currentBlock())[0]
|
|
227
227
|
if (isUndefined(currentHead)) return
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
this._producers.insert(address, start, stop)
|
|
243
|
-
}
|
|
228
|
+
const currentHeadHash = currentHead._hash
|
|
229
|
+
const chainMap = readPayloadMapFromStore<WithStorageMeta<Payload>>(this.chainArchivist)
|
|
230
|
+
const result = await analyzeChain({ chainMap }, [new ChainStakeIntentAnalyzer('producer')], currentHeadHash, this._lastIndexedBlockHash)
|
|
231
|
+
const signedDeclarations = filterAs(result.find(isChainSummaryStakeIntent)?.intents ?? [], asChainStakeIntent)
|
|
232
|
+
if (currentHead.block === undefined) return
|
|
233
|
+
const currentHeadBlockNum = currentHead.block
|
|
234
|
+
if (displayProgress) this.logger?.log(`Updating index through 0x${currentHeadBlockNum}`)
|
|
235
|
+
for (const signedDeclaration of signedDeclarations) {
|
|
236
|
+
const { exp, nbf } = signedDeclaration
|
|
237
|
+
const start = nbf
|
|
238
|
+
const stop = exp
|
|
239
|
+
const address = asAddress(signedDeclaration?.from)
|
|
240
|
+
if (start !== undefined && stop !== undefined && address !== undefined) {
|
|
241
|
+
this._producers.insert(address, start, stop)
|
|
244
242
|
}
|
|
245
|
-
|
|
243
|
+
}
|
|
244
|
+
/*
|
|
246
245
|
if (index % STATE_PERSISTENCE_INTERVAL === 0n) {
|
|
247
246
|
if (displayProgress) this.logger?.info(`Persisting state at block ${index}`)
|
|
248
247
|
await this.persistState(await PayloadBuilder.hash(block))
|
|
249
248
|
}
|
|
250
249
|
*/
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
})
|
|
250
|
+
this._lastIndexedBlockHash = currentHeadHash
|
|
251
|
+
}, { timeBudgetLimit: 1000 })
|
|
254
252
|
})
|
|
255
253
|
}
|
|
256
254
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from './AccountBalance/index.ts'
|
|
2
2
|
export * from './BlockReward/index.ts'
|
|
3
3
|
export * from './blockViewerFromChainIteratorAndArchivist.ts'
|
|
4
|
-
export * from './ChainService/index.ts'
|
|
5
4
|
export * from './ChainValidator/index.ts'
|
|
6
5
|
export * from './Election/index.ts'
|
|
7
6
|
export * from './implementation/index.ts'
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Address,
|
|
3
|
-
assertEx, exists, Hex, hexToBigInt, isDefined, Promisable,
|
|
2
|
+
Address, assertEx, exists, Hex, hexToBigInt, isDefined, Promisable,
|
|
4
3
|
} from '@xylabs/sdk-js'
|
|
5
4
|
import { AccountInstance } from '@xyo-network/account-model'
|
|
6
5
|
import { MemoryArchivist } from '@xyo-network/archivist-memory'
|
|
@@ -12,29 +11,11 @@ import { buildNextBlock } from '@xyo-network/chain-protocol'
|
|
|
12
11
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
13
12
|
import { WithHashMeta } from '@xyo-network/payload-model'
|
|
14
13
|
import {
|
|
15
|
-
AbstractCreatableProvider,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
BlockRewardViewerMoniker,
|
|
21
|
-
BlockRunner,
|
|
22
|
-
BlockRunnerMoniker,
|
|
23
|
-
BlockValidationViewer,
|
|
24
|
-
BlockValidationViewerMoniker,
|
|
25
|
-
ChainStakeIntent, creatableProvider,
|
|
26
|
-
CreatableProviderParams,
|
|
27
|
-
createDeclarationIntent,
|
|
28
|
-
defaultRewardRatio, HydratedBlockStateValidationFunction,
|
|
29
|
-
MempoolRunner,
|
|
30
|
-
MempoolRunnerMoniker,
|
|
31
|
-
MempoolViewer,
|
|
32
|
-
MempoolViewerMoniker,
|
|
33
|
-
SignedBlockBoundWitnessWithHashMeta,
|
|
34
|
-
SignedHydratedBlockWithHashMeta, SignedHydratedTransaction,
|
|
35
|
-
TimeSyncViewer,
|
|
36
|
-
TimeSyncViewerMoniker,
|
|
37
|
-
Transfer, XYO_STEP_REWARD_ADDRESS,
|
|
14
|
+
AbstractCreatableProvider, AccountBalanceViewer, AccountBalanceViewerMoniker, AllowedBlockPayload, asBlockBoundWitness, AttoXL1, BlockBoundWitness,
|
|
15
|
+
BlockNumberPayload, BlockNumberSchema, BlockRewardViewer, BlockRewardViewerMoniker, BlockRunner, BlockRunnerMoniker, BlockValidationViewer,
|
|
16
|
+
BlockValidationViewerMoniker, ChainId, ChainStakeIntent, creatableProvider, CreatableProviderParams, createDeclarationIntent, defaultRewardRatio,
|
|
17
|
+
HydratedBlockStateValidationFunction, MempoolRunner, MempoolRunnerMoniker, MempoolViewer, MempoolViewerMoniker, SignedBlockBoundWitnessWithHashMeta,
|
|
18
|
+
SignedHydratedBlockWithHashMeta, SignedHydratedTransaction, TimeSyncViewer, TimeSyncViewerMoniker, Transfer, XYO_STEP_REWARD_ADDRESS,
|
|
38
19
|
} from '@xyo-network/xl1-sdk'
|
|
39
20
|
|
|
40
21
|
import { generateTransactionFeeTransfers } from './generateTransactionFeeTransfers.ts'
|
|
@@ -55,7 +36,7 @@ export const XYO_PRODUCER_REDECLARATION_DURATION = 10_000
|
|
|
55
36
|
*/
|
|
56
37
|
export const XYO_PRODUCER_REDECLARATION_WINDOW = 500
|
|
57
38
|
|
|
58
|
-
export
|
|
39
|
+
export interface SimpleBlockRunnerParams extends CreatableProviderParams {
|
|
59
40
|
account: AccountInstance
|
|
60
41
|
rejectedTransactionsArchivist?: ArchivistInstance
|
|
61
42
|
rewardAddress: Address
|
|
@@ -86,6 +67,7 @@ export class SimpleBlockRunner extends AbstractCreatableProvider<SimpleBlockRunn
|
|
|
86
67
|
private _address?: Address
|
|
87
68
|
private _blockRewardViewer?: BlockRewardViewer
|
|
88
69
|
private _blockValidationViewer?: BlockValidationViewer
|
|
70
|
+
private _chainId?: ChainId
|
|
89
71
|
private _mempoolRunner?: MempoolRunner
|
|
90
72
|
private _mempoolViewer?: MempoolViewer
|
|
91
73
|
private _rewardAddress?: Address
|
|
@@ -134,6 +116,10 @@ export class SimpleBlockRunner extends AbstractCreatableProvider<SimpleBlockRunn
|
|
|
134
116
|
return this._blockValidationViewer!
|
|
135
117
|
}
|
|
136
118
|
|
|
119
|
+
protected get chainId() {
|
|
120
|
+
return this._chainId
|
|
121
|
+
}
|
|
122
|
+
|
|
137
123
|
// protected get electionService() {
|
|
138
124
|
// return assertEx(this.params.electionService, () => 'electionService is required')
|
|
139
125
|
// }
|
|
@@ -177,6 +163,7 @@ export class SimpleBlockRunner extends AbstractCreatableProvider<SimpleBlockRunn
|
|
|
177
163
|
this._accountBalanceViewer = await this.locateAndCreate<AccountBalanceViewer>(AccountBalanceViewerMoniker)
|
|
178
164
|
this._blockRewardViewer = await this.locateAndCreate<BlockRewardViewer>(BlockRewardViewerMoniker)
|
|
179
165
|
this._blockValidationViewer = await this.locator.getInstance<BlockValidationViewer>(BlockValidationViewerMoniker)
|
|
166
|
+
this._chainId = this.context.config.chain.id
|
|
180
167
|
this._mempoolRunner = await this.locateAndCreate<MempoolRunner>(MempoolRunnerMoniker)
|
|
181
168
|
this._mempoolViewer = await this.locateAndCreate<MempoolViewer>(MempoolViewerMoniker)
|
|
182
169
|
this._rewardAddress = this.params.rewardAddress ?? this.context.config.producer.rewardAddress
|
|
@@ -289,7 +276,16 @@ export class SimpleBlockRunner extends AbstractCreatableProvider<SimpleBlockRunn
|
|
|
289
276
|
this.logger?.info(`Building block ${head.block + 1}`)
|
|
290
277
|
const startBuild = Date.now()
|
|
291
278
|
const stepRewardPoolBalance = (await this.accountBalanceViewer.accountBalances([XYO_STEP_REWARD_ADDRESS]))[XYO_STEP_REWARD_ADDRESS]
|
|
292
|
-
const block = await buildNextBlock(
|
|
279
|
+
const block = await buildNextBlock(
|
|
280
|
+
head,
|
|
281
|
+
fundedNextBlockTransactions,
|
|
282
|
+
blockPayloads,
|
|
283
|
+
[this.account],
|
|
284
|
+
XYO_STEP_REWARD_ADDRESS,
|
|
285
|
+
stepRewardPoolBalance,
|
|
286
|
+
undefined,
|
|
287
|
+
this.chainId,
|
|
288
|
+
)
|
|
293
289
|
|
|
294
290
|
this.logger?.info(
|
|
295
291
|
`Built block ${block[0].block} in ${Date.now() - startBuild}ms with ${block[1].length} payloads`,
|
|
@@ -297,7 +293,7 @@ export class SimpleBlockRunner extends AbstractCreatableProvider<SimpleBlockRunn
|
|
|
297
293
|
|
|
298
294
|
this.logger?.info(`Validating block ${block[0].block} with ${block[1].length} payloads`)
|
|
299
295
|
const startValidate = Date.now()
|
|
300
|
-
const errors = await this.blockValidationViewer.validateBlock(block)
|
|
296
|
+
const errors = await this.blockValidationViewer.validateBlock(block, { head: head._hash })
|
|
301
297
|
this.logger?.info(`Validated block ${block[0].block} in ${Date.now() - startValidate}ms with ${block[1].length} payloads`)
|
|
302
298
|
|
|
303
299
|
if (errors.length > 0) {
|
|
@@ -312,7 +308,7 @@ export class SimpleBlockRunner extends AbstractCreatableProvider<SimpleBlockRunn
|
|
|
312
308
|
this.logger?.error(`Error proposing next valid block: ${(error as Error).message}`)
|
|
313
309
|
throw error
|
|
314
310
|
}
|
|
315
|
-
})
|
|
311
|
+
}, { timeBudgetLimit: 200 })
|
|
316
312
|
}
|
|
317
313
|
|
|
318
314
|
// remove unfunded transactions and block transfers
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { Address, Hex, Promisable } from '@xylabs/sdk-js';
|
|
2
|
-
import type { StakedXyoChain } from '@xyo-network/typechain';
|
|
3
|
-
import type { AttoXL1, ChainService, XL1BlockNumber } from '@xyo-network/xl1-sdk';
|
|
4
|
-
import { AbstractCreatableProvider } from '@xyo-network/xl1-sdk';
|
|
5
|
-
import type { ContractRunner } from 'ethers/providers';
|
|
6
|
-
import type { BaseServiceParams } from '../../model/index.ts';
|
|
7
|
-
export interface EvmChainViewerParams extends BaseServiceParams {
|
|
8
|
-
contract: StakedXyoChain;
|
|
9
|
-
id: Hex;
|
|
10
|
-
runner: ContractRunner;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* A class that represents a chain stake as backed by an EVM smart contract
|
|
14
|
-
*/
|
|
15
|
-
export declare class EvmChainViewer extends AbstractCreatableProvider<EvmChainViewerParams> implements ChainService {
|
|
16
|
-
static readonly defaultMoniker: "ChainContractViewer";
|
|
17
|
-
static readonly monikers: "ChainContractViewer"[];
|
|
18
|
-
moniker: "ChainContractViewer";
|
|
19
|
-
protected get contract(): StakedXyoChain;
|
|
20
|
-
active(): Promise<bigint>;
|
|
21
|
-
activeByStaked(staked: Address): Promise<bigint>;
|
|
22
|
-
activeByStaker(address: Address): Promise<bigint>;
|
|
23
|
-
addStake(staked: Address, amount: bigint): Promise<boolean>;
|
|
24
|
-
forkedAtBlockNumber(): Promise<bigint>;
|
|
25
|
-
forkedAtHash(): Promise<bigint>;
|
|
26
|
-
forkedChainId(): Promise<Address>;
|
|
27
|
-
minWithdrawalBlocks(): Promise<bigint>;
|
|
28
|
-
pending(): Promise<bigint>;
|
|
29
|
-
pendingByStaker(staker: Address): Promise<bigint>;
|
|
30
|
-
removeStake(slot: bigint): Promise<boolean>;
|
|
31
|
-
rewardForBlock(_block: XL1BlockNumber): Promisable<AttoXL1>;
|
|
32
|
-
rewardsContract(): Promise<string>;
|
|
33
|
-
stakingTokenAddress(): Promise<string>;
|
|
34
|
-
withdrawStake(slot: bigint): Promise<boolean>;
|
|
35
|
-
withdrawn(): Promise<bigint>;
|
|
36
|
-
withdrawnByStaker(staker: string): Promise<bigint>;
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=Evm.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Evm.d.ts","sourceRoot":"","sources":["../../../../src/ChainService/Evm/Evm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAAE,GAAG,EAAE,UAAU,EACzB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,KAAK,EACV,OAAO,EAAE,YAAY,EAAE,cAAc,EACtC,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,yBAAyB,EAA8B,MAAM,sBAAsB,CAAA;AAE5F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAE7D,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;IAC7D,QAAQ,EAAE,cAAc,CAAA;IACxB,EAAE,EAAE,GAAG,CAAA;IACP,MAAM,EAAE,cAAc,CAAA;CACvB;AAED;;GAEG;AACH,qBAAa,cAAe,S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sources":["../../../../src/ChainService/Evm/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { Address, Hex, Promisable } from '@xylabs/sdk-js';
|
|
2
|
-
import type { AttoXL1, ChainService, XL1BlockNumber } from '@xyo-network/xl1-sdk';
|
|
3
|
-
import { AbstractCreatableProvider } from '@xyo-network/xl1-sdk';
|
|
4
|
-
import type { BaseServiceParams } from '../../model/index.ts';
|
|
5
|
-
export interface MemoryChainViewerParams extends BaseServiceParams {
|
|
6
|
-
chainId: Hex;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* A class that represents a chain stake as backed in memory
|
|
10
|
-
*/
|
|
11
|
-
export declare class MemoryChainViewer extends AbstractCreatableProvider<MemoryChainViewerParams> implements ChainService {
|
|
12
|
-
static readonly defaultMoniker: "ChainContractViewer";
|
|
13
|
-
static readonly monikers: "ChainContractViewer"[];
|
|
14
|
-
moniker: "ChainContractViewer";
|
|
15
|
-
protected _chainId: Hex | undefined;
|
|
16
|
-
protected _simulatedStake: bigint;
|
|
17
|
-
active(): Promise<bigint>;
|
|
18
|
-
activeByStaked(_staked: Address): Promise<bigint>;
|
|
19
|
-
activeByStaker(_address: string): Promise<bigint>;
|
|
20
|
-
addStake(_staked: string, _amount: bigint): Promise<boolean>;
|
|
21
|
-
createHandler(): void;
|
|
22
|
-
forkedAtBlockNumber(): Promise<bigint>;
|
|
23
|
-
forkedAtHash(): Promise<bigint>;
|
|
24
|
-
forkedChainId(): Promise<Address>;
|
|
25
|
-
minWithdrawalBlocks(): Promise<bigint>;
|
|
26
|
-
pending(): Promise<bigint>;
|
|
27
|
-
pendingByStaker(_staker: string): Promise<bigint>;
|
|
28
|
-
removeStake(_slot: bigint): Promise<boolean>;
|
|
29
|
-
rewardForBlock(_block: XL1BlockNumber): Promisable<AttoXL1>;
|
|
30
|
-
rewardsContract(): Promise<string>;
|
|
31
|
-
stakingTokenAddress(): Promise<string>;
|
|
32
|
-
withdrawStake(_slot: bigint): Promise<boolean>;
|
|
33
|
-
withdrawn(): Promise<bigint>;
|
|
34
|
-
withdrawnByStaker(_staker: string): Promise<bigint>;
|
|
35
|
-
protected startHandler(): Promise<void>;
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=Memory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Memory.d.ts","sourceRoot":"","sources":["../../../../src/ChainService/Memory/Memory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAAE,GAAG,EAAE,UAAU,EACzB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,KAAK,EACV,OAAO,EACP,YAAY,EAAE,cAAc,EAC7B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,yBAAyB,EAA8B,MAAM,sBAAsB,CAAA;AAE5F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAE7D,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;IAChE,OAAO,EAAE,GAAG,CAAA;CACb;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,yBAAyB,CAAC,uBAAuB,CAAE,YAAW,YAAY;IAC/G,MAAM,CAAC,QAAQ,CAAC,cAAc,wBAA6B;IAC3D,MAAM,CAAC,QAAQ,CAAC,QAAQ,0BAA+B;IAC9C,OAAO,wBAAmC;IAEnD,SAAS,CAAC,QAAQ,EAAE,GAAG,GAAG,SAAS,CAAA;IACnC,SAAS,CAAC,eAAe,EAAE,MAAM,CAAK;IAEhC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAIzB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAIjD,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAIjD,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OA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