-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: adjust blockTime
inside InboxTools.findFirstBlockBelow
in v3
#475
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
blockTime
inside InboxTools.findFirstBlockBelow
in v3
src/lib/inbox/inbox.ts
Outdated
this.l1Provider as JsonRpcProvider | ||
) | ||
const currentArbBlock = await arbProvider.getBlock( | ||
await arbProvider.getBlockNumber() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can use "latest" instead of making 2 calls?
src/lib/inbox/inbox.ts
Outdated
@@ -183,7 +234,8 @@ export class InboxTools { | |||
await multicall.multiCall(multicallInput, true) | |||
|
|||
const firstEligibleBlockNumber = | |||
currentBlockNumber.toNumber() - maxTimeVariation.delayBlocks.toNumber() | |||
(currentL1BlockNumber ?? currentBlockNumber.toNumber()) - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use isParentChainArbitrum ?
instead of currentL1BlockNumber ??
, doesn't matter too much tho
src/lib/inbox/inbox.ts
Outdated
@@ -90,6 +95,38 @@ export class InboxTools { | |||
blockNumber: number, | |||
blockTimestamp: number | |||
): Promise<Block> { | |||
const isParentChainArbitrum = await isArbitrumChain(this.l1Provider) | |||
|
|||
const nodeInterface = NodeInterface__factory.connect( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be defined within the next if
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const diffBlocks = Math.max(Math.ceil(diff / this.l1Network.blockTime), 10)
I think we need to hardcode the blocktime here because we want to real "L1" block time here but l1Network.blockTime
for a L3 chain can be the L2 block time?
No description provided.