Skip to content

Commit

Permalink
feat(relay): Update relay to work with finalized header DendrethAdada…
Browse files Browse the repository at this point in the history
…pter
  • Loading branch information
Dimo99 committed Aug 30, 2024
1 parent 3e167d0 commit c8047e8
Show file tree
Hide file tree
Showing 10 changed files with 170 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,35 @@
pragma solidity 0.8.9;

interface ILightClient {
function currentIndex() external view returns (uint256);
struct LightClientUpdate {
bytes32 attestedHeaderRoot;
uint256 attestedHeaderSlot;
bytes32 finalizedHeaderRoot;
bytes32 finalizedExecutionStateRoot;
uint256[2] a;
uint256[2][2] b;
uint256[2] c;
}

function optimisticHeaderRoot() external view returns (bytes32);
function currentIndex() external view returns (uint256);

function optimisticHeaderSlot() external view returns (uint256);
function optimisticHeaderRoot() external view returns (bytes32);

function finalizedHeaderRoot() external view returns (bytes32);
function optimisticHeaderSlot() external view returns (uint256);

function executionStateRoot() external view returns (bytes32);
function finalizedHeaderRoot() external view returns (bytes32);

function optimisticHeaders(uint256 index) external view returns (bytes32);
function executionStateRoot() external view returns (bytes32);

function optimisticSlots(uint256 index) external view returns (uint256);
function optimisticHeaders(uint256 index) external view returns (bytes32);

function finalizedHeaders(uint256 index) external view returns (bytes32);
function optimisticSlots(uint256 index) external view returns (uint256);

function executionStateRoots(uint256 index) external view returns (bytes32);
function finalizedHeaders(uint256 index) external view returns (bytes32);

function executionStateRoots(uint256 index) external view returns (bytes32);

function lightClientUpdate(
LightClientUpdate calldata update
) external payable;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@ import '../../interfaces/ILightClient.sol';
uint256 constant BUFER_SIZE = 32;

contract BeaconLightClient is LightClientUpdateVerifier, ILightClient {
struct LightClientUpdate {
bytes32 attestedHeaderRoot;
uint256 attestedHeaderSlot;
bytes32 finalizedHeaderRoot;
bytes32 finalizedExecutionStateRoot;
uint256[2] a;
uint256[2][2] b;
uint256[2] c;
}

bytes32[BUFER_SIZE] public optimisticHeaders;

uint256[BUFER_SIZE] public optimisticSlots;
Expand Down Expand Up @@ -62,7 +52,7 @@ contract BeaconLightClient is LightClientUpdateVerifier, ILightClient {
}

// TODO: fix name to lightClientUpdate
function light_client_update(LightClientUpdate calldata update)
function lightClientUpdate(LightClientUpdate calldata update)
external
payable
{
Expand Down
9 changes: 8 additions & 1 deletion beacon-light-client/solidity/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,16 @@ export default {
bscTestnet: conf.BSC_ETHERSCAN_API_KEY,
chiado: conf.CHIADO_ETHERSCAN_API,
gnosis: conf.GNOSIS_ETHERSCAN_API,
lukso: conf.ETHERSCAN_API_KEY,
},
customChains: [
{
network: "chiado",
chainId: 10200,
urls: {
apiURL: "https://gnosis-chiado.blockscout.com/api",
browserURL: "https://gnosis-chiado.blockscout.com/",
},
},
{
network: 'baseGoerli',
chainId: 84531,
Expand Down
Loading

0 comments on commit c8047e8

Please sign in to comment.