Skip to content
This repository has been archived by the owner on Dec 5, 2021. It is now read-only.

Commit

Permalink
Fix message relayers and check gas price (#558)
Browse files Browse the repository at this point in the history
* Add waiting period

* The message relayers scan the following txs until the pending relayed messages are solved

* Add failedMessage and check gas price (#561)

* Add failureMessages

* Add blockedMessages controller

* Add MessageBlocked and MessageAllowed events

* Simplify contracts

* Add failedMessage and check gas

Co-authored-by: CAPtheorem <79423264+CAPtheorem@users.noreply.github.com>
  • Loading branch information
boyuan-chen and CAPtheorem committed Oct 6, 2021
1 parent 9c4d5c4 commit 33c33ca
Show file tree
Hide file tree
Showing 9 changed files with 470 additions and 247 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class TransactionBatchSubmitter extends BatchSubmitter {
)
this.disableQueueBatchAppend = disableQueueBatchAppend
this.autoFixBatchOptions = autoFixBatchOptions
this.gasThresholdInGwei = 500
this.gasThresholdInGwei = gasThresholdInGwei
this.transactionSubmitter = transactionSubmitter
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ contract OVM_L1CrossDomainMessenger is
mapping (bytes32 => bool) public blockedMessages;
mapping (bytes32 => bool) public relayedMessages;
mapping (bytes32 => bool) public successfulMessages;
mapping (bytes32 => bool) public failedMessages;

address internal xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;

Expand Down Expand Up @@ -278,6 +279,7 @@ contract OVM_L1CrossDomainMessenger is
successfulMessages[xDomainCalldataHash] = true;
emit RelayedMessage(xDomainCalldataHash);
} else {
failedMessages[xDomainCalldataHash] = true;
emit FailedRelayedMessage(xDomainCalldataHash);
}

Expand Down
8 changes: 3 additions & 5 deletions packages/message-relayer/src/exec/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,8 @@ const main = async () => {
'from-l2-transaction-index',
parseInt(env.FROM_L2_TRANSACTION_INDEX, 10) || 0
)
const FILTER_ENDPOINT = config.str(
'filter-endpoint',
env.FILTER_ENDPOINT
) || ''
const FILTER_ENDPOINT =
config.str('filter-endpoint', env.FILTER_ENDPOINT) || ''
const FILTER_POLLING_INTERVAL = config.uint(
'filter-polling-interval',
parseInt(env.FILTER_POLLING_INTERVAL, 10) || 60000
Expand All @@ -101,7 +99,7 @@ const main = async () => {
)
const NUM_CONFIRMATIONS = config.uint(
'num-confirmations',
parseInt(env.NUM_CONFIRMATIONS, 10) || 0
parseInt(env.NUM_CONFIRMATIONS, 10) || 0
)

if (!ADDRESS_MANAGER_ADDRESS) {
Expand Down
Loading

0 comments on commit 33c33ca

Please sign in to comment.