@chainsafe/lodestar-config
Advanced tools
Comparing version 0.23.0 to 0.23.1-alpha.0
@@ -1,5 +0,4 @@ | ||
import { IBeaconParams } from "@chainsafe/lodestar-params"; | ||
import { IBeaconConfig } from "./interface"; | ||
export * from "./interface"; | ||
export declare function createIBeaconConfig(params: IBeaconParams): IBeaconConfig; | ||
export * from "./chainConfig"; | ||
export * from "./forkConfig"; | ||
export * from "./beaconConfig"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -6,21 +6,25 @@ "use strict"; | ||
}); | ||
var _exportNames = { | ||
createIBeaconConfig: true | ||
}; | ||
exports.createIBeaconConfig = createIBeaconConfig; | ||
var _lodestarParams = require("@chainsafe/lodestar-params"); | ||
var _chainConfig = require("./chainConfig"); | ||
var _lodestarTypes = require("@chainsafe/lodestar-types"); | ||
Object.keys(_chainConfig).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (key in exports && exports[key] === _chainConfig[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function () { | ||
return _chainConfig[key]; | ||
} | ||
}); | ||
}); | ||
var _interface = require("./interface"); | ||
var _forkConfig = require("./forkConfig"); | ||
Object.keys(_interface).forEach(function (key) { | ||
Object.keys(_forkConfig).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _interface[key]) return; | ||
if (key in exports && exports[key] === _forkConfig[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function () { | ||
return _interface[key]; | ||
return _forkConfig[key]; | ||
} | ||
@@ -30,56 +34,14 @@ }); | ||
var _forkTypes = require("./forkTypes"); | ||
var _beaconConfig = require("./beaconConfig"); | ||
function createIBeaconConfig(params) { | ||
const types = (0, _lodestarTypes.createIBeaconSSZTypes)(params); | ||
const forkTypes = (0, _forkTypes.getForkTypesRecord)(types); | ||
const phase0 = { | ||
name: _interface.ForkName.phase0, | ||
epoch: _lodestarParams.GENESIS_EPOCH, | ||
version: params.GENESIS_FORK_VERSION | ||
}; | ||
const altair = { | ||
name: _interface.ForkName.altair, | ||
epoch: params.ALTAIR_FORK_EPOCH, | ||
version: params.ALTAIR_FORK_VERSION | ||
}; | ||
/** Forks in order order of occurence, `phase0` first */ | ||
// Note: Downstream code relies on proper ordering. | ||
const forks = { | ||
phase0, | ||
altair | ||
}; // Prevents allocating an array on every getForkInfo() call | ||
const forksDescendingEpochOrder = Object.values(forks).reverse(); | ||
return { | ||
params, | ||
types, | ||
forks, | ||
// Fork convenience methods | ||
getForkInfo(slot) { | ||
const epoch = Math.floor(slot / this.params.SLOTS_PER_EPOCH); // NOTE: forks must be sorted by descending epoch, latest fork first | ||
for (const fork of forksDescendingEpochOrder) { | ||
if (epoch >= fork.epoch) return fork; | ||
} | ||
return phase0; | ||
}, | ||
getForkName(slot) { | ||
return this.getForkInfo(slot).name; | ||
}, | ||
getForkVersion(slot) { | ||
return this.getForkInfo(slot).version; | ||
}, | ||
getForkTypes(slot) { | ||
return forkTypes[this.getForkName(slot)]; | ||
Object.keys(_beaconConfig).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (key in exports && exports[key] === _beaconConfig[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function () { | ||
return _beaconConfig[key]; | ||
} | ||
}; | ||
} | ||
}); | ||
}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@chainsafe/lodestar-config", | ||
"version": "0.23.0", | ||
"version": "0.23.1-alpha.0+7ff5465", | ||
"description": "Chain configuration required for lodestar", | ||
@@ -47,6 +47,7 @@ "author": "ChainSafe Systems", | ||
"dependencies": { | ||
"@chainsafe/lodestar-params": "^0.23.0", | ||
"@chainsafe/lodestar-types": "^0.23.0" | ||
"@chainsafe/lodestar-params": "^0.23.1-alpha.0+7ff5465", | ||
"@chainsafe/lodestar-types": "^0.23.1-alpha.0+7ff5465", | ||
"@chainsafe/ssz": "^0.8.7" | ||
}, | ||
"gitHead": "8f4e720c0ed5b701149e2b432c22f0c2b536555a" | ||
"gitHead": "7ff5465baa2414e78c9b0519ff3e262f1d09f36d" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55811
36
491
3
1
2
+ Added@chainsafe/ssz@^0.8.7
+ Added@chainsafe/lodestar-params@0.23.1-next.e41e763041a989b1726fa655c4e23b3c1795352c.0(transitive)
+ Added@chainsafe/lodestar-types@0.23.1-next.e41e763041a989b1726fa655c4e23b3c1795352c.0(transitive)
- Removed@chainsafe/lodestar-params@0.23.0(transitive)
- Removed@chainsafe/lodestar-types@0.23.0(transitive)