Commit b1d83700 authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub

Merge branch 'develop' into jg/step_in_agent

parents 5951ed36 9e8647e8
---
'@eth-optimism/sdk': patch
---
Fixed missing indexes for multicall support
...@@ -4,7 +4,10 @@ ...@@ -4,7 +4,10 @@
"defaultBase": "develop" "defaultBase": "develop"
}, },
"implicitDependencies": { "implicitDependencies": {
"nx.json": "*" "nx.json": "*",
"tsconfig.json": "*",
".foundryrc": "*",
".nvmrc": "*"
}, },
"tasksRunnerOptions": { "tasksRunnerOptions": {
"default": { "default": {
......
...@@ -15,7 +15,7 @@ type Metrics interface { ...@@ -15,7 +15,7 @@ type Metrics interface {
RecordL1Ref(name string, ref eth.L1BlockRef) RecordL1Ref(name string, ref eth.L1BlockRef)
RecordL2Ref(name string, ref eth.L2BlockRef) RecordL2Ref(name string, ref eth.L2BlockRef)
RecordUnsafePayloadsBuffer(length uint64, memSize uint64, next eth.BlockID) RecordUnsafePayloadsBuffer(length uint64, memSize uint64, next eth.BlockID)
RecordChannelInputBytes(inputCompresedBytes int) RecordChannelInputBytes(inputCompressedBytes int)
} }
type L1Fetcher interface { type L1Fetcher interface {
......
...@@ -21,7 +21,7 @@ type Metrics interface { ...@@ -21,7 +21,7 @@ type Metrics interface {
RecordL1Ref(name string, ref eth.L1BlockRef) RecordL1Ref(name string, ref eth.L1BlockRef)
RecordL2Ref(name string, ref eth.L2BlockRef) RecordL2Ref(name string, ref eth.L2BlockRef)
RecordChannelInputBytes(inputCompresedBytes int) RecordChannelInputBytes(inputCompressedBytes int)
RecordUnsafePayloadsBuffer(length uint64, memSize uint64, next eth.BlockID) RecordUnsafePayloadsBuffer(length uint64, memSize uint64, next eth.BlockID)
......
...@@ -11,7 +11,7 @@ type TestDerivationMetrics struct { ...@@ -11,7 +11,7 @@ type TestDerivationMetrics struct {
FnRecordL1Ref func(name string, ref eth.L1BlockRef) FnRecordL1Ref func(name string, ref eth.L1BlockRef)
FnRecordL2Ref func(name string, ref eth.L2BlockRef) FnRecordL2Ref func(name string, ref eth.L2BlockRef)
FnRecordUnsafePayloads func(length uint64, memSize uint64, next eth.BlockID) FnRecordUnsafePayloads func(length uint64, memSize uint64, next eth.BlockID)
FnRecordChannelInputBytes func(inputCompresedBytes int) FnRecordChannelInputBytes func(inputCompressedBytes int)
} }
func (t *TestDerivationMetrics) RecordL1ReorgDepth(d uint64) { func (t *TestDerivationMetrics) RecordL1ReorgDepth(d uint64) {
...@@ -38,9 +38,9 @@ func (t *TestDerivationMetrics) RecordUnsafePayloadsBuffer(length uint64, memSiz ...@@ -38,9 +38,9 @@ func (t *TestDerivationMetrics) RecordUnsafePayloadsBuffer(length uint64, memSiz
} }
} }
func (t *TestDerivationMetrics) RecordChannelInputBytes(inputCompresedBytes int) { func (t *TestDerivationMetrics) RecordChannelInputBytes(inputCompressedBytes int) {
if t.FnRecordChannelInputBytes != nil { if t.FnRecordChannelInputBytes != nil {
t.FnRecordChannelInputBytes(inputCompresedBytes) t.FnRecordChannelInputBytes(inputCompressedBytes)
} }
} }
......
...@@ -1563,9 +1563,17 @@ export class CrossChainMessenger { ...@@ -1563,9 +1563,17 @@ export class CrossChainMessenger {
opts?: { opts?: {
signer?: Signer signer?: Signer
overrides?: Overrides overrides?: Overrides
} },
/**
* The index of the withdrawal if multiple are made with multicall
*/
messageIndex: number = 0
): Promise<TransactionResponse> { ): Promise<TransactionResponse> {
const tx = await this.populateTransaction.proveMessage(message, opts) const tx = await this.populateTransaction.proveMessage(
message,
opts,
messageIndex
)
return (opts?.signer || this.l1Signer).sendTransaction(tx) return (opts?.signer || this.l1Signer).sendTransaction(tx)
} }
...@@ -1584,10 +1592,18 @@ export class CrossChainMessenger { ...@@ -1584,10 +1592,18 @@ export class CrossChainMessenger {
opts?: { opts?: {
signer?: Signer signer?: Signer
overrides?: PayableOverrides overrides?: PayableOverrides
} },
/**
* The index of the withdrawal if multiple are made with multicall
*/
messageIndex = 0
): Promise<TransactionResponse> { ): Promise<TransactionResponse> {
return (opts?.signer || this.l1Signer).sendTransaction( return (opts?.signer || this.l1Signer).sendTransaction(
await this.populateTransaction.finalizeMessage(message, opts) await this.populateTransaction.finalizeMessage(
message,
opts,
messageIndex
)
) )
} }
...@@ -1810,7 +1826,6 @@ export class CrossChainMessenger { ...@@ -1810,7 +1826,6 @@ export class CrossChainMessenger {
opts?: { opts?: {
overrides?: Overrides overrides?: Overrides
}, },
/** /**
* The index of the withdrawal if multiple are made with multicall * The index of the withdrawal if multiple are made with multicall
*/ */
...@@ -1822,13 +1837,17 @@ export class CrossChainMessenger { ...@@ -1822,13 +1837,17 @@ export class CrossChainMessenger {
} }
if (this.bedrock) { if (this.bedrock) {
return this.populateTransaction.finalizeMessage(resolved, { return this.populateTransaction.finalizeMessage(
...(opts || {}), resolved,
overrides: { {
...opts?.overrides, ...(opts || {}),
gasLimit: messageGasLimit, overrides: {
...opts?.overrides,
gasLimit: messageGasLimit,
},
}, },
}) messageIndex
)
} else { } else {
const legacyL1XDM = new ethers.Contract( const legacyL1XDM = new ethers.Contract(
this.contracts.l1.L1CrossDomainMessenger.address, this.contracts.l1.L1CrossDomainMessenger.address,
...@@ -1861,7 +1880,6 @@ export class CrossChainMessenger { ...@@ -1861,7 +1880,6 @@ export class CrossChainMessenger {
opts?: { opts?: {
overrides?: PayableOverrides overrides?: PayableOverrides
}, },
/** /**
* The index of the withdrawal if multiple are made with multicall * The index of the withdrawal if multiple are made with multicall
*/ */
...@@ -1921,7 +1939,6 @@ export class CrossChainMessenger { ...@@ -1921,7 +1939,6 @@ export class CrossChainMessenger {
opts?: { opts?: {
overrides?: PayableOverrides overrides?: PayableOverrides
}, },
/** /**
* The index of the withdrawal if multiple are made with multicall * The index of the withdrawal if multiple are made with multicall
*/ */
...@@ -2229,10 +2246,18 @@ export class CrossChainMessenger { ...@@ -2229,10 +2246,18 @@ export class CrossChainMessenger {
message: MessageLike, message: MessageLike,
opts?: { opts?: {
overrides?: CallOverrides overrides?: CallOverrides
} },
/**
* The index of the withdrawal if multiple are made with multicall
*/
messageIndex = 0
): Promise<BigNumber> => { ): Promise<BigNumber> => {
return this.l1Provider.estimateGas( return this.l1Provider.estimateGas(
await this.populateTransaction.finalizeMessage(message, opts) await this.populateTransaction.finalizeMessage(
message,
opts,
messageIndex
)
) )
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment