Compare commits

..

No commits in common. "v0.1.0-develop.15" and "v0.1.0-develop.14" have entirely different histories.

5 changed files with 6 additions and 42 deletions

View File

@ -1,10 +1,3 @@
# [0.1.0-develop.15](https://git.lumeweb.com/LumeWeb/libethsync/compare/v0.1.0-develop.14...v0.1.0-develop.15) (2023-07-11)
### Bug Fixes
* implement isValidLightClientHeader ([6f07421](https://git.lumeweb.com/LumeWeb/libethsync/commit/6f07421fe80f008255cbe472204d8530e2bb3352))
# [0.1.0-develop.14](https://git.lumeweb.com/LumeWeb/libethsync/compare/v0.1.0-develop.13...v0.1.0-develop.14) (2023-07-11) # [0.1.0-develop.14](https://git.lumeweb.com/LumeWeb/libethsync/compare/v0.1.0-develop.13...v0.1.0-develop.14) (2023-07-11)

View File

@ -1,7 +1,6 @@
MIT License MIT License
Copyright (c) 2023 Hammer Technologies LLC Copyright (c) <year> <copyright holders>
Copyright (c) 2022 Shresth Agrawal
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

4
npm-shrinkwrap.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@lumeweb/libethclient", "name": "@lumeweb/libethclient",
"version": "0.1.0-develop.15", "version": "0.1.0-develop.14",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@lumeweb/libethclient", "name": "@lumeweb/libethclient",
"version": "0.1.0-develop.15", "version": "0.1.0-develop.14",
"dependencies": { "dependencies": {
"@chainsafe/as-sha256": "^0.3.1", "@chainsafe/as-sha256": "^0.3.1",
"@chainsafe/bls": "7.1.1", "@chainsafe/bls": "7.1.1",

View File

@ -1,6 +1,6 @@
{ {
"name": "@lumeweb/libethsync", "name": "@lumeweb/libethsync",
"version": "0.1.0-develop.15", "version": "0.1.0-develop.14",
"type": "module", "type": "module",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -1,9 +1,4 @@
import { import { createBeaconConfig } from "@lodestar/config";
createBeaconConfig,
BeaconConfig,
ChainForkConfig,
} from "@lodestar/config";
import { allForks } from "@lodestar/types";
import { BEACON_SYNC_SUPER_MAJORITY, mainnetConfig } from "./constants.js"; import { BEACON_SYNC_SUPER_MAJORITY, mainnetConfig } from "./constants.js";
import { networksChainConfig } from "@lodestar/config/networks"; import { networksChainConfig } from "@lodestar/config/networks";
import { fromHexString } from "@chainsafe/ssz"; import { fromHexString } from "@chainsafe/ssz";
@ -14,14 +9,7 @@ import axiosRetry from "axios-retry";
import axios from "axios"; import axios from "axios";
import { digest } from "@chainsafe/as-sha256"; import { digest } from "@chainsafe/as-sha256";
import { concatBytes } from "@noble/hashes/utils"; import { concatBytes } from "@noble/hashes/utils";
import { import { deserializeSyncCommittee } from "@lodestar/light-client/utils";
deserializeSyncCommittee,
isValidMerkleBranch,
} from "@lodestar/light-client/utils";
import {
BLOCK_BODY_EXECUTION_PAYLOAD_DEPTH as EXECUTION_PAYLOAD_DEPTH,
BLOCK_BODY_EXECUTION_PAYLOAD_INDEX as EXECUTION_PAYLOAD_INDEX,
} from "@lodestar/params";
export function getDefaultClientConfig() { export function getDefaultClientConfig() {
const chainConfig = createBeaconConfig( const chainConfig = createBeaconConfig(
@ -115,19 +103,3 @@ export async function getConsensusOptimisticUpdate() {
return update.data; return update.data;
} }
function isValidLightClientHeader(
config: ChainForkConfig,
header: allForks.LightClientHeader,
): boolean {
return isValidMerkleBranch(
config
.getExecutionForkTypes(header.beacon.slot)
.ExecutionPayloadHeader.hashTreeRoot(
(header as capella.LightClientHeader).execution,
),
(header as capella.LightClientHeader).executionBranch,
EXECUTION_PAYLOAD_DEPTH,
EXECUTION_PAYLOAD_INDEX,
header.beacon.bodyRoot,
);
}