-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from base-org/jack/ts-filler-local-support
update ts-filler to support local chains for proof generation
- Loading branch information
Showing
12 changed files
with
204 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { defineChain } from "viem"; | ||
|
||
export const chainA = defineChain({ | ||
id: 111111, | ||
name: "Chain A", | ||
nativeCurrency: { | ||
decimals: 18, | ||
name: "Ether", | ||
symbol: "ETH", | ||
}, | ||
rpcUrls: { | ||
default: { | ||
http: ["http://localhost:8546"], | ||
}, | ||
}, | ||
blockExplorers: { | ||
default: { name: "Explorer", url: "" }, | ||
}, | ||
contracts: {}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { defineChain } from "viem"; | ||
|
||
export const chainB = defineChain({ | ||
id: 111112, | ||
name: "Chain B", | ||
nativeCurrency: { | ||
decimals: 18, | ||
name: "Ether", | ||
symbol: "ETH", | ||
}, | ||
rpcUrls: { | ||
default: { | ||
http: ["http://localhost:8547"], | ||
}, | ||
}, | ||
blockExplorers: { | ||
default: { name: "Explorer", url: "" }, | ||
}, | ||
contracts: {}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { defineChain } from "viem"; | ||
|
||
export const mockL1 = defineChain({ | ||
id: 31337, | ||
name: "Mock L1", | ||
nativeCurrency: { | ||
decimals: 18, | ||
name: "Ether", | ||
symbol: "ETH", | ||
}, | ||
rpcUrls: { | ||
default: { | ||
http: ["http://localhost:8545"], | ||
}, | ||
}, | ||
blockExplorers: { | ||
default: { name: "Explorer", url: "" }, | ||
}, | ||
contracts: {}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { sha256, encodePacked } from "viem"; | ||
|
||
import constants from "../constants"; | ||
|
||
export default function deriveBeaconRoot(curr: `0x${string}`): `0x${string}` { | ||
let index = 6434; | ||
const types = ["bytes32", "bytes32"]; | ||
|
||
for (let i = 0; i < constants.mockL1StateRootProof.length; i++) { | ||
const preImage = [constants.mockL1StateRootProof[i], curr]; | ||
|
||
if ((index & 1) === 0) { | ||
preImage.reverse(); | ||
} | ||
|
||
curr = sha256(encodePacked(types, preImage)); | ||
|
||
index >>= 1; | ||
} | ||
|
||
return curr; | ||
} |
13 changes: 0 additions & 13 deletions
13
services/ts-filler/src/common/utils/deriveDstStorageSlot.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters