Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
ocnc authored Sep 12, 2024
2 parents 4ec16c8 + 685fbf2 commit 901fa49
Show file tree
Hide file tree
Showing 91 changed files with 566 additions and 940 deletions.
2 changes: 1 addition & 1 deletion beacond/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ require (
github.com/berachain/beacon-kit/mod/node-api/engines v0.0.0-20240806160829-cde2d1347e7e
github.com/berachain/beacon-kit/mod/node-core v0.0.0-20240821225446-81f31b0aac98
github.com/berachain/beacon-kit/mod/payload v0.0.0-20240705193247-d464364483df
github.com/berachain/beacon-kit/mod/primitives v0.0.0-20240825202904-98dbc4268be1
github.com/berachain/beacon-kit/mod/primitives v0.0.0-20240911165923-82f71ec86570
github.com/berachain/beacon-kit/mod/state-transition v0.0.0-20240717225334-64ec6650da31
github.com/berachain/beacon-kit/mod/storage v0.0.0-20240822205119-6d7f90fac7d7
github.com/cosmos/cosmos-sdk v0.53.0
Expand Down
4 changes: 2 additions & 2 deletions beacond/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ github.com/berachain/beacon-kit/mod/node-api/engines v0.0.0-20240806160829-cde2d
github.com/berachain/beacon-kit/mod/node-api/engines v0.0.0-20240806160829-cde2d1347e7e/go.mod h1:lj5dEWEjUn4Mj9/qVrCKrfGqE7FCObk39VfqXs3Eo/E=
github.com/berachain/beacon-kit/mod/payload v0.0.0-20240705193247-d464364483df h1:fLL+7ZZcbVOmE3XE0o+ZGS8zyPLjki7LrZAsXpcG4Sc=
github.com/berachain/beacon-kit/mod/payload v0.0.0-20240705193247-d464364483df/go.mod h1:wbSa9W1CDDzR9AptQfYf/16bWqktaIQIZdJsuKWeqC8=
github.com/berachain/beacon-kit/mod/primitives v0.0.0-20240825202904-98dbc4268be1 h1:cYa9o1Lbyz6QkC/X5bECJ1S2p22PeFIlX8svZmIb8+c=
github.com/berachain/beacon-kit/mod/primitives v0.0.0-20240825202904-98dbc4268be1/go.mod h1:Mrq1qol8vbkgZp2IMPFwngg75qE3k9IvT2MouBEhuus=
github.com/berachain/beacon-kit/mod/primitives v0.0.0-20240911165923-82f71ec86570 h1:w0Gkg31VQRFDv0EJjYgVtlpza7kSaJq7U28zxZjfZeE=
github.com/berachain/beacon-kit/mod/primitives v0.0.0-20240911165923-82f71ec86570/go.mod h1:Mrq1qol8vbkgZp2IMPFwngg75qE3k9IvT2MouBEhuus=
github.com/berachain/beacon-kit/mod/state-transition v0.0.0-20240717225334-64ec6650da31 h1:1bJbJcoksyXfYMiga8YxPnkVKqT1lKwym/8kZnEPz58=
github.com/berachain/beacon-kit/mod/state-transition v0.0.0-20240717225334-64ec6650da31/go.mod h1:sIzib45R7B9Q99yvsYUcj2xJZPBpe3J9JbcBDMZNp7E=
github.com/berachain/cosmos-sdk v0.46.0-beta2.0.20240808182639-7bdbf06a94f2 h1:4qwOPga+dKeDelSJ6pseasQq6fcjd7iXhah0y7enuco=
Expand Down
Empty file removed contracts/README.md
Empty file.
21 changes: 0 additions & 21 deletions contracts/script/DeployAndCallERC20.s.sol

This file was deleted.

235 changes: 0 additions & 235 deletions contracts/src/eip4788/BeaconVerifier.sol

This file was deleted.

39 changes: 1 addition & 38 deletions contracts/src/eip4788/SSZ.sol
Original file line number Diff line number Diff line change
@@ -1,51 +1,14 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.21;

/// @notice Library for SSZ (Simple Serialize) proof verification.
/// @author [madlabman](https://github.com/madlabman/eip-4788-proof)
library SSZ {
/// @dev SHA256 precompile address.
uint8 internal constant SHA256 = 0x02;
/// @dev Length of the validator pubkey in bytes.
uint8 internal constant VALIDATOR_PUBKEY_LENGTH = 48;

error BranchHasMissingItem();
error BranchHasExtraItem();
error InvalidValidatorPubkeyLength();

function validatorPubkeyHashTreeRoot(bytes memory pubkey)
internal
view
returns (bytes32 root)
{
if (pubkey.length != VALIDATOR_PUBKEY_LENGTH) {
revert InvalidValidatorPubkeyLength();
}

assembly {
// Call sha256 precompile with the pubkey pointer
let result :=
staticcall(gas(), SHA256, add(pubkey, 32), 0x40, 0x00, 0x20)
// Precompile returns no data on OutOfGas error.
if eq(result, 0) { revert(0, 0) }

root := mload(0x00)
}
}

function addressHashTreeRoot(address v)
internal
pure
returns (bytes32 root)
{
return bytes32(bytes20(v));
}

function uint64HashTreeRoot(uint64 v) internal pure returns (bytes32) {
v = ((v & 0xFF00FF00FF00FF00) >> 8) | ((v & 0x00FF00FF00FF00FF) << 8);
v = ((v & 0xFFFF0000FFFF0000) >> 16) | ((v & 0x0000FFFF0000FFFF) << 16);
v = (v >> 32) | (v << 32);
return bytes32(uint256(v) << 192);
}

/// @notice Modified version of `verify` from `MerkleProofLib` to support
/// generalized indices and sha256 precompile.
Expand Down
28 changes: 0 additions & 28 deletions contracts/src/eip4788/Verifier.sol

This file was deleted.

Loading

0 comments on commit 901fa49

Please sign in to comment.