Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
fc64f875
Commit
fc64f875
authored
Jun 21, 2023
by
Kevin Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fault-detector: Remove pre-bedrock support.
parent
52eb1a26
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
141 additions
and
258 deletions
+141
-258
helpers.ts
packages/fault-detector/src/helpers.ts
+9
-9
service.ts
packages/fault-detector/src/service.ts
+131
-248
helpers.spec.ts
packages/fault-detector/test/helpers.spec.ts
+1
-1
No files found.
packages/fault-detector/src/helpers.ts
View file @
fc64f875
import
{
Contract
,
BigNumber
}
from
'
ethers
'
import
{
Logger
}
from
'
@eth-optimism/common-ts
'
export
interface
OutputOracle
<
TSubmissionEventArgs
>
{
export
interface
OutputOracle
{
contract
:
Contract
filter
:
any
getTotalElements
:
()
=>
Promise
<
BigNumber
>
getEventIndex
:
(
args
:
TSubmissionEventArgs
)
=>
BigNumber
getEventIndex
:
(
args
:
any
)
=>
BigNumber
}
/**
...
...
@@ -54,8 +54,8 @@ const getCache = (
* @param contract Contract to update cache for.
* @param filter Event filter to use.
*/
export
const
updateOracleCache
=
async
<
TSubmissionEventArgs
>
(
oracle
:
OutputOracle
<
TSubmissionEventArgs
>
,
export
const
updateOracleCache
=
async
(
oracle
:
OutputOracle
,
logger
?:
Logger
):
Promise
<
void
>
=>
{
const
cache
=
getCache
(
oracle
.
contract
.
address
)
...
...
@@ -86,7 +86,7 @@ export const updateOracleCache = async <TSubmissionEventArgs>(
// Throw the events into the cache.
for
(
const
event
of
events
)
{
cache
.
eventCache
[
oracle
.
getEventIndex
(
event
.
args
as
TSubmissionEventArgs
).
toNumber
()
oracle
.
getEventIndex
(
event
.
args
).
toNumber
()
]
=
{
blockNumber
:
event
.
blockNumber
,
transactionHash
:
event
.
transactionHash
,
...
...
@@ -135,8 +135,8 @@ export const updateOracleCache = async <TSubmissionEventArgs>(
* @param index State batch index to search for.
* @returns Event corresponding to the batch.
*/
export
const
findEventForStateBatch
=
async
<
TSubmissionEventArgs
>
(
oracle
:
OutputOracle
<
TSubmissionEventArgs
>
,
export
const
findEventForStateBatch
=
async
(
oracle
:
OutputOracle
,
index
:
number
,
logger
?:
Logger
):
Promise
<
PartialEvent
>
=>
{
...
...
@@ -166,8 +166,8 @@ export const findEventForStateBatch = async <TSubmissionEventArgs>(
* @param oracle Output oracle contract.
* @returns Starting state root batch index.
*/
export
const
findFirstUnfinalizedStateBatchIndex
=
async
<
TSubmissionEventArgs
>
(
oracle
:
OutputOracle
<
TSubmissionEventArgs
>
,
export
const
findFirstUnfinalizedStateBatchIndex
=
async
(
oracle
:
OutputOracle
,
fpw
:
number
,
logger
?:
Logger
):
Promise
<
number
>
=>
{
...
...
packages/fault-detector/src/service.ts
View file @
fc64f875
This diff is collapsed.
Click to expand it.
packages/fault-detector/test/helpers.spec.ts
View file @
fc64f875
...
...
@@ -29,7 +29,7 @@ describe('helpers', () => {
let
AddressManager
:
Contract
let
ChainStorageContainer
:
Contract
let
StateCommitmentChain
:
Contract
let
oracle
:
OutputOracle
<
any
>
let
oracle
:
OutputOracle
beforeEach
(
async
()
=>
{
// Set up fakes
FakeBondManager
=
await
smock
.
fake
(
getContractInterface
(
'
BondManager
'
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment