Commit b860fc66 authored by elenadimitrova's avatar elenadimitrova Committed by Kelvin Fichter

Rename OVM_L1CrossDomainMessenger to L1CrossDomainMessenger

parent a1c899ff
......@@ -31,7 +31,7 @@ fi
envSet L1_CROSS_DOMAIN_MESSENGER_ADDRESS Proxy__OVM_L1CrossDomainMessenger
if [ $L1_CROSS_DOMAIN_MESSENGER_ADDRESS == null ]; then
envSet L1_CROSS_DOMAIN_MESSENGER_ADDRESS OVM_L1CrossDomainMessenger
envSet L1_CROSS_DOMAIN_MESSENGER_ADDRESS L1CrossDomainMessenger
fi
# build the dump file
......
......@@ -25,14 +25,14 @@ import { ReentrancyGuardUpgradeable } from
"@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol";
/**
* @title OVM_L1CrossDomainMessenger
* @title L1CrossDomainMessenger
* @dev The L1 Cross Domain Messenger contract sends messages from L1 to L2, and relays messages
* from L2 onto L1. In the event that a message sent from L1 to L2 is rejected for exceeding the L2
* epoch gas limit, it can be resubmitted via this contract's replay function.
*
* Runtime target: EVM
*/
contract OVM_L1CrossDomainMessenger is
contract L1CrossDomainMessenger is
IL1CrossDomainMessenger,
Lib_AddressResolver,
OwnableUpgradeable,
......
......@@ -36,8 +36,8 @@ contract OVM_L2ToL1MessagePasser is iOVM_L2ToL1MessagePasser {
public
{
// Note: although this function is public, only messages sent from the
// OVM_L2CrossDomainMessenger will be relayed by the OVM_L1CrossDomainMessenger.
// This is enforced by a check in OVM_L1CrossDomainMessenger._verifyStorageProof().
// OVM_L2CrossDomainMessenger will be relayed by the L1CrossDomainMessenger.
// This is enforced by a check in L1CrossDomainMessenger._verifyStorageProof().
sentMessages[keccak256(
abi.encodePacked(
_message,
......
......@@ -16,7 +16,7 @@ const deployFn: DeployFunction = async (hre) => {
}
)
const result = await deploy('OVM_L1CrossDomainMessenger', {
const result = await deploy('L1CrossDomainMessenger', {
from: deployer,
args: [],
log: true,
......@@ -26,9 +26,9 @@ const deployFn: DeployFunction = async (hre) => {
return
}
const OVM_L1CrossDomainMessenger = await getDeployedContract(
const L1CrossDomainMessenger = await getDeployedContract(
hre,
'OVM_L1CrossDomainMessenger',
'L1CrossDomainMessenger',
{
signerOrProvider: deployer,
}
......@@ -37,13 +37,13 @@ const deployFn: DeployFunction = async (hre) => {
// NOTE: this initialization is *not* technically required (we only need to initialize the proxy)
// but it feels safer to initialize this anyway. Otherwise someone else could come along and
// initialize this.
await OVM_L1CrossDomainMessenger.initialize(Lib_AddressManager.address)
await L1CrossDomainMessenger.initialize(Lib_AddressManager.address)
const libAddressManager = await OVM_L1CrossDomainMessenger.libAddressManager()
const libAddressManager = await L1CrossDomainMessenger.libAddressManager()
if (libAddressManager !== Lib_AddressManager.address) {
throw new Error(
`\n**FATAL ERROR. THIS SHOULD NEVER HAPPEN. CHECK YOUR DEPLOYMENT.**:\n` +
`OVM_L1CrossDomainMessenger could not be succesfully initialized.\n` +
`L1CrossDomainMessenger could not be succesfully initialized.\n` +
`Attempted to set Lib_AddressManager to: ${Lib_AddressManager.address}\n` +
`Actual address after initialization: ${libAddressManager}\n` +
`This could indicate a compromised deployment.`
......@@ -51,12 +51,12 @@ const deployFn: DeployFunction = async (hre) => {
}
await Lib_AddressManager.setAddress(
'OVM_L1CrossDomainMessenger',
'L1CrossDomainMessenger',
result.address
)
}
deployFn.dependencies = ['Lib_AddressManager']
deployFn.tags = ['OVM_L1CrossDomainMessenger']
deployFn.tags = ['L1CrossDomainMessenger']
export default deployFn
......@@ -19,7 +19,7 @@ const deployFn: DeployFunction = async (hre) => {
const result = await deploy('Proxy__OVM_L1CrossDomainMessenger', {
contract: 'Lib_ResolvedDelegateProxy',
from: deployer,
args: [Lib_AddressManager.address, 'OVM_L1CrossDomainMessenger'],
args: [Lib_AddressManager.address, 'L1CrossDomainMessenger'],
log: true,
})
......@@ -32,7 +32,7 @@ const deployFn: DeployFunction = async (hre) => {
'Proxy__OVM_L1CrossDomainMessenger',
{
signerOrProvider: deployer,
iface: 'OVM_L1CrossDomainMessenger',
iface: 'L1CrossDomainMessenger',
}
)
......@@ -56,7 +56,7 @@ const deployFn: DeployFunction = async (hre) => {
)
}
deployFn.dependencies = ['Lib_AddressManager', 'OVM_L1CrossDomainMessenger']
deployFn.dependencies = ['Lib_AddressManager', 'L1CrossDomainMessenger']
deployFn.tags = ['Proxy__OVM_L1CrossDomainMessenger']
export default deployFn
......@@ -71,7 +71,7 @@ const networks = {
proxiedContracts = []
for (let i = 0; i < contracts.length; i++) {
if (contracts[i] === 'OVM_L1CrossDomainMessenger') {
if (contracts[i] === 'L1CrossDomainMessenger') {
proxiedContracts.push(contracts.splice(i, 1)[0])
}
if (contracts[i] === 'OVM_L1ETHGateway') {
......
......@@ -10,21 +10,21 @@ import { Network } from './connect-contracts'
const Mainnet__Lib_AddressManager = require('../deployments/mainnet/Lib_AddressManager.json')
const Mainnet__OVM_CanonicalTransactionChain = require('../deployments/mainnet/OVM_CanonicalTransactionChain.json')
const Mainnet__OVM_L1CrossDomainMessenger = require('../deployments/mainnet/OVM_L1CrossDomainMessenger.json')
const Mainnet__OVM_L1CrossDomainMessenger = require('../deployments/mainnet/L1CrossDomainMessenger.json')
const Mainnet__OVM_StateCommitmentChain = require('../deployments/mainnet/OVM_StateCommitmentChain.json')
const Mainnet__Proxy__OVM_L1CrossDomainMessenger = require('../deployments/mainnet/Proxy__OVM_L1CrossDomainMessenger.json')
const Mainnet__OVM_BondManager = require('../deployments/mainnet/mockOVM_BondManager.json')
const Kovan__Lib_AddressManager = require('../deployments/kovan/Lib_AddressManager.json')
const Kovan__OVM_CanonicalTransactionChain = require('../deployments/kovan/OVM_CanonicalTransactionChain.json')
const Kovan__OVM_L1CrossDomainMessenger = require('../deployments/kovan/OVM_L1CrossDomainMessenger.json')
const Kovan__OVM_L1CrossDomainMessenger = require('../deployments/kovan/L1CrossDomainMessenger.json')
const Kovan__OVM_StateCommitmentChain = require('../deployments/kovan/OVM_StateCommitmentChain.json')
const Kovan__Proxy__OVM_L1CrossDomainMessenger = require('../deployments/kovan/Proxy__OVM_L1CrossDomainMessenger.json')
const Kovan__OVM_BondManager = require('../deployments/kovan/mockOVM_BondManager.json')
const Goerli__Lib_AddressManager = require('../deployments/goerli/Lib_AddressManager.json')
const Goerli__OVM_CanonicalTransactionChain = require('../deployments/goerli/OVM_CanonicalTransactionChain.json')
const Goerli__OVM_L1CrossDomainMessenger = require('../deployments/goerli/OVM_L1CrossDomainMessenger.json')
const Goerli__OVM_L1CrossDomainMessenger = require('../deployments/goerli/L1CrossDomainMessenger.json')
const Goerli__OVM_StateCommitmentChain = require('../deployments/goerli/OVM_StateCommitmentChain.json')
const Goerli__Proxy__OVM_L1CrossDomainMessenger = require('../deployments/goerli/Proxy__OVM_L1CrossDomainMessenger.json')
const Goerli__OVM_BondManager = require('../deployments/goerli/mockOVM_BondManager.json')
......@@ -41,7 +41,7 @@ export const getL1ContractData = (network: Network) => {
kovan: Kovan__OVM_CanonicalTransactionChain,
goerli: Goerli__OVM_CanonicalTransactionChain,
}[network],
OVM_L1CrossDomainMessenger: {
L1CrossDomainMessenger: {
mainnet: Mainnet__OVM_L1CrossDomainMessenger,
kovan: Kovan__OVM_L1CrossDomainMessenger,
goerli: Goerli__OVM_L1CrossDomainMessenger,
......
......@@ -30,16 +30,16 @@ const deployProxyXDomainMessenger = async (
l1XDomainMessenger: Contract
): Promise<Contract> => {
await addressManager.setAddress(
'OVM_L1CrossDomainMessenger',
'L1CrossDomainMessenger',
l1XDomainMessenger.address
)
const proxy = await (
await ethers.getContractFactory('Lib_ResolvedDelegateProxy')
).deploy(addressManager.address, 'OVM_L1CrossDomainMessenger')
).deploy(addressManager.address, 'L1CrossDomainMessenger')
return l1XDomainMessenger.attach(proxy.address)
}
describe('OVM_L1CrossDomainMessenger', () => {
describe('L1CrossDomainMessenger', () => {
let signer: Signer
let signer2: Signer
before(async () => {
......@@ -94,7 +94,7 @@ describe('OVM_L1CrossDomainMessenger', () => {
)
Factory__OVM_L1CrossDomainMessenger = await ethers.getContractFactory(
'OVM_L1CrossDomainMessenger'
'L1CrossDomainMessenger'
)
OVM_CanonicalTransactionChain =
await Factory__OVM_CanonicalTransactionChain.deploy(
......@@ -129,31 +129,31 @@ describe('OVM_L1CrossDomainMessenger', () => {
)
})
let OVM_L1CrossDomainMessenger: Contract
let L1CrossDomainMessenger: Contract
beforeEach(async () => {
const xDomainMessengerImpl =
await Factory__OVM_L1CrossDomainMessenger.deploy()
// We use an upgradable proxy for the XDomainMessenger--deploy & set up the proxy.
OVM_L1CrossDomainMessenger = await deployProxyXDomainMessenger(
L1CrossDomainMessenger = await deployProxyXDomainMessenger(
AddressManager,
xDomainMessengerImpl
)
await OVM_L1CrossDomainMessenger.initialize(AddressManager.address)
await L1CrossDomainMessenger.initialize(AddressManager.address)
})
describe('pause', () => {
describe('when called by the current owner', () => {
it('should pause the contract', async () => {
await OVM_L1CrossDomainMessenger.pause()
await L1CrossDomainMessenger.pause()
expect(await OVM_L1CrossDomainMessenger.paused()).to.be.true
expect(await L1CrossDomainMessenger.paused()).to.be.true
})
})
describe('when called by account other than the owner', () => {
it('should not pause the contract', async () => {
await expect(
OVM_L1CrossDomainMessenger.connect(signer2).pause()
L1CrossDomainMessenger.connect(signer2).pause()
).to.be.revertedWith('Ownable: caller is not the owner')
})
})
......@@ -186,7 +186,7 @@ describe('OVM_L1CrossDomainMessenger', () => {
it('should be able to send a single message', async () => {
await expect(
OVM_L1CrossDomainMessenger.sendMessage(target, message, gasLimit)
L1CrossDomainMessenger.sendMessage(target, message, gasLimit)
).to.not.be.reverted
const calldata = encodeXDomainCalldata(
......@@ -196,7 +196,7 @@ describe('OVM_L1CrossDomainMessenger', () => {
0
)
const transactionHash = getTransactionHash(
OVM_L1CrossDomainMessenger.address,
L1CrossDomainMessenger.address,
Mock__OVM_L2CrossDomainMessenger.address,
gasLimit,
calldata
......@@ -210,10 +210,10 @@ describe('OVM_L1CrossDomainMessenger', () => {
})
it('should be able to send the same message twice', async () => {
await OVM_L1CrossDomainMessenger.sendMessage(target, message, gasLimit)
await L1CrossDomainMessenger.sendMessage(target, message, gasLimit)
await expect(
OVM_L1CrossDomainMessenger.sendMessage(target, message, gasLimit)
L1CrossDomainMessenger.sendMessage(target, message, gasLimit)
).to.not.be.reverted
})
})
......@@ -224,11 +224,11 @@ describe('OVM_L1CrossDomainMessenger', () => {
const gasLimit = 100_000
it('should revert if given the wrong queue index', async () => {
await OVM_L1CrossDomainMessenger.sendMessage(target, message, 100_001)
await L1CrossDomainMessenger.sendMessage(target, message, 100_001)
const queueLength = await OVM_CanonicalTransactionChain.getQueueLength()
await expect(
OVM_L1CrossDomainMessenger.replayMessage(
L1CrossDomainMessenger.replayMessage(
target,
await signer.getAddress(),
message,
......@@ -239,7 +239,7 @@ describe('OVM_L1CrossDomainMessenger', () => {
})
it('should succeed if the message exists', async () => {
await OVM_L1CrossDomainMessenger.sendMessage(target, message, gasLimit)
await L1CrossDomainMessenger.sendMessage(target, message, gasLimit)
const queueLength = await OVM_CanonicalTransactionChain.getQueueLength()
const calldata = encodeXDomainCalldata(
......@@ -249,7 +249,7 @@ describe('OVM_L1CrossDomainMessenger', () => {
queueLength - 1
)
await expect(
OVM_L1CrossDomainMessenger.replayMessage(
L1CrossDomainMessenger.replayMessage(
Mock__OVM_L2CrossDomainMessenger.address,
await signer.getAddress(),
calldata,
......@@ -366,7 +366,7 @@ describe('OVM_L1CrossDomainMessenger', () => {
}
await expect(
OVM_L1CrossDomainMessenger.relayMessage(
L1CrossDomainMessenger.relayMessage(
target,
sender,
message,
......@@ -384,7 +384,7 @@ describe('OVM_L1CrossDomainMessenger', () => {
)
await expect(
OVM_L1CrossDomainMessenger.relayMessage(
L1CrossDomainMessenger.relayMessage(
OVM_CanonicalTransactionChain.address,
sender,
message,
......@@ -410,7 +410,7 @@ describe('OVM_L1CrossDomainMessenger', () => {
}
await expect(
OVM_L1CrossDomainMessenger.relayMessage(
L1CrossDomainMessenger.relayMessage(
target,
sender,
message,
......@@ -422,7 +422,7 @@ describe('OVM_L1CrossDomainMessenger', () => {
it('should revert if provided an invalid storage trie witness', async () => {
await expect(
OVM_L1CrossDomainMessenger.relayMessage(target, sender, message, 0, {
L1CrossDomainMessenger.relayMessage(target, sender, message, 0, {
...proof,
storageTrieWitness: '0x',
})
......@@ -431,7 +431,7 @@ describe('OVM_L1CrossDomainMessenger', () => {
it('should revert if provided an invalid state trie witness', async () => {
await expect(
OVM_L1CrossDomainMessenger.relayMessage(target, sender, message, 0, {
L1CrossDomainMessenger.relayMessage(target, sender, message, 0, {
...proof,
stateTrieWitness: '0x',
})
......@@ -441,7 +441,7 @@ describe('OVM_L1CrossDomainMessenger', () => {
it('should send a successful call to the target contract', async () => {
const blockNumber = await getNextBlockNumber(ethers.provider)
await OVM_L1CrossDomainMessenger.relayMessage(
await L1CrossDomainMessenger.relayMessage(
target,
sender,
message,
......@@ -450,11 +450,11 @@ describe('OVM_L1CrossDomainMessenger', () => {
)
expect(
await OVM_L1CrossDomainMessenger.successfulMessages(keccak256(calldata))
await L1CrossDomainMessenger.successfulMessages(keccak256(calldata))
).to.equal(true)
expect(
await OVM_L1CrossDomainMessenger.relayedMessages(
await L1CrossDomainMessenger.relayedMessages(
keccak256(
calldata +
remove0x(await signer.getAddress()) +
......@@ -469,9 +469,9 @@ describe('OVM_L1CrossDomainMessenger', () => {
it('the xDomainMessageSender is reset to the original value', async () => {
await expect(
OVM_L1CrossDomainMessenger.xDomainMessageSender()
L1CrossDomainMessenger.xDomainMessageSender()
).to.be.revertedWith('xDomainMessageSender is not set')
await OVM_L1CrossDomainMessenger.relayMessage(
await L1CrossDomainMessenger.relayMessage(
target,
sender,
message,
......@@ -479,12 +479,12 @@ describe('OVM_L1CrossDomainMessenger', () => {
proof
)
await expect(
OVM_L1CrossDomainMessenger.xDomainMessageSender()
L1CrossDomainMessenger.xDomainMessageSender()
).to.be.revertedWith('xDomainMessageSender is not set')
})
it('should revert if trying to send the same message twice', async () => {
await OVM_L1CrossDomainMessenger.relayMessage(
await L1CrossDomainMessenger.relayMessage(
target,
sender,
message,
......@@ -493,7 +493,7 @@ describe('OVM_L1CrossDomainMessenger', () => {
)
await expect(
OVM_L1CrossDomainMessenger.relayMessage(
L1CrossDomainMessenger.relayMessage(
target,
sender,
message,
......@@ -504,10 +504,10 @@ describe('OVM_L1CrossDomainMessenger', () => {
})
it('should revert if paused', async () => {
await OVM_L1CrossDomainMessenger.pause()
await L1CrossDomainMessenger.pause()
await expect(
OVM_L1CrossDomainMessenger.relayMessage(
L1CrossDomainMessenger.relayMessage(
target,
sender,
message,
......@@ -520,7 +520,7 @@ describe('OVM_L1CrossDomainMessenger', () => {
describe('blockMessage and allowMessage', () => {
it('should revert if called by an account other than the owner', async () => {
const OVM_L1CrossDomainMessenger2 =
OVM_L1CrossDomainMessenger.connect(signer2)
L1CrossDomainMessenger.connect(signer2)
await expect(
OVM_L1CrossDomainMessenger2.blockMessage(keccak256(calldata))
).to.be.revertedWith('Ownable: caller is not the owner')
......@@ -531,10 +531,10 @@ describe('OVM_L1CrossDomainMessenger', () => {
})
it('should revert if the message is blocked', async () => {
await OVM_L1CrossDomainMessenger.blockMessage(keccak256(calldata))
await L1CrossDomainMessenger.blockMessage(keccak256(calldata))
await expect(
OVM_L1CrossDomainMessenger.relayMessage(
L1CrossDomainMessenger.relayMessage(
target,
sender,
message,
......@@ -545,10 +545,10 @@ describe('OVM_L1CrossDomainMessenger', () => {
})
it('should succeed if the message is blocked, then unblocked', async () => {
await OVM_L1CrossDomainMessenger.blockMessage(keccak256(calldata))
await L1CrossDomainMessenger.blockMessage(keccak256(calldata))
await expect(
OVM_L1CrossDomainMessenger.relayMessage(
L1CrossDomainMessenger.relayMessage(
target,
sender,
message,
......@@ -557,10 +557,10 @@ describe('OVM_L1CrossDomainMessenger', () => {
)
).to.be.revertedWith('Provided message has been blocked.')
await OVM_L1CrossDomainMessenger.allowMessage(keccak256(calldata))
await L1CrossDomainMessenger.allowMessage(keccak256(calldata))
await expect(
OVM_L1CrossDomainMessenger.relayMessage(
L1CrossDomainMessenger.relayMessage(
target,
sender,
message,
......@@ -580,7 +580,7 @@ describe('OVM_L1CrossDomainMessenger', () => {
)
await expect(
OVM_L1CrossDomainMessenger.relayMessage(
L1CrossDomainMessenger.relayMessage(
target,
sender,
message,
......
......@@ -57,7 +57,7 @@ describe('OVM_L1StandardBridge', () => {
beforeEach(async () => {
// Get a new mock L1 messenger
Mock__OVM_L1CrossDomainMessenger = await smockit(
await ethers.getContractFactory('OVM_L1CrossDomainMessenger'),
await ethers.getContractFactory('L1CrossDomainMessenger'),
{ address: await l1MessengerImpersonator.getAddress() } // This allows us to use an ethers override {from: Mock__OVM_L2CrossDomainMessenger.address} to mock calls
)
......
......@@ -30,7 +30,7 @@ describe('OVM_L2CrossDomainMessenger', () => {
await ethers.getContractFactory('Helper_SimpleProxy')
)
Mock__OVM_L1CrossDomainMessenger = await smockit(
await ethers.getContractFactory('OVM_L1CrossDomainMessenger')
await ethers.getContractFactory('L1CrossDomainMessenger')
)
Mock__OVM_L1MessageSender = await smockit(
getContractInterface('iOVM_L1MessageSender'),
......@@ -101,7 +101,7 @@ describe('OVM_L2CrossDomainMessenger', () => {
)
})
it('should revert if the L1 message sender is not the OVM_L1CrossDomainMessenger', async () => {
it('should revert if the L1 message sender is not the L1CrossDomainMessenger', async () => {
Mock__OVM_L1MessageSender.smocked.getL1MessageSender.will.return.with(
constants.AddressZero
)
......
......@@ -36,7 +36,7 @@ const main = async () => {
const l1CrossDomainMessenger = new ethers.Contract(
l1CrossDomainMessengerAddress,
getContractInterface('OVM_L1CrossDomainMessenger'),
getContractInterface('L1CrossDomainMessenger'),
l1Wallet
)
......
......@@ -73,7 +73,7 @@ export class MessageRelayerService extends BaseService<MessageRelayerOptions> {
eventCache: ethers.Event[]
Lib_AddressManager: Contract
OVM_StateCommitmentChain: Contract
OVM_L1CrossDomainMessenger: Contract
L1CrossDomainMessenger: Contract
OVM_L2CrossDomainMessenger: Contract
OVM_L2ToL1MessagePasser: Contract
}
......@@ -108,15 +108,15 @@ export class MessageRelayerService extends BaseService<MessageRelayerOptions> {
address: this.state.OVM_StateCommitmentChain.address,
})
this.logger.info('Connecting to OVM_L1CrossDomainMessenger...')
this.state.OVM_L1CrossDomainMessenger = await loadContractFromManager({
name: 'OVM_L1CrossDomainMessenger',
this.logger.info('Connecting to L1CrossDomainMessenger...')
this.state.L1CrossDomainMessenger = await loadContractFromManager({
name: 'L1CrossDomainMessenger',
proxy: 'Proxy__OVM_L1CrossDomainMessenger',
Lib_AddressManager: this.state.Lib_AddressManager,
provider: this.options.l1RpcProvider,
})
this.logger.info('Connected to OVM_L1CrossDomainMessenger', {
address: this.state.OVM_L1CrossDomainMessenger.address,
this.logger.info('Connected to L1CrossDomainMessenger', {
address: this.state.L1CrossDomainMessenger.address,
})
this.logger.info('Connecting to OVM_L2CrossDomainMessenger...')
......@@ -417,7 +417,7 @@ export class MessageRelayerService extends BaseService<MessageRelayerOptions> {
}
private async _wasMessageRelayed(message: SentMessage): Promise<boolean> {
return this.state.OVM_L1CrossDomainMessenger.successfulMessages(
return this.state.L1CrossDomainMessenger.successfulMessages(
message.encodedMessageHash
)
}
......@@ -497,7 +497,7 @@ export class MessageRelayerService extends BaseService<MessageRelayerOptions> {
try {
this.logger.info('Dry-run, checking to make sure proof would succeed...')
await this.state.OVM_L1CrossDomainMessenger.connect(
await this.state.L1CrossDomainMessenger.connect(
this.options.l1Wallet
).callStatic.relayMessage(
message.target,
......@@ -520,7 +520,7 @@ export class MessageRelayerService extends BaseService<MessageRelayerOptions> {
return
}
const result = await this.state.OVM_L1CrossDomainMessenger.connect(
const result = await this.state.L1CrossDomainMessenger.connect(
this.options.l1Wallet
).relayMessage(
message.target,
......
......@@ -24,7 +24,7 @@ There are two 'low level' bridge contracts (the L1 and L2 Cross Domain Messenger
**Then on L1:**
- The `Relayer` (and currently only the `Relayer`) may call `OVM_L1CrossDomainMessenger.relayMessage()` providing the raw message inputs and an L2 inclusion proof.
- The `Relayer` (and currently only the `Relayer`) may call `L1CrossDomainMessenger.relayMessage()` providing the raw message inputs and an L2 inclusion proof.
- The validity of the message is confirmed by the following functions:
- `_verifyStateRootProof()`:
- checks that the fraud proof window has closed for the batch to which the transaction belongs.
......@@ -33,13 +33,13 @@ There are two 'low level' bridge contracts (the L1 and L2 Cross Domain Messenger
- checks the proof to confirm that the message data provided is in the `OVM_L2ToL1MessagePasser.sentMessages` mapping
- checks that this transaction has not already been written to the `successfulMessages` mapping.
- The address of the L2 `ovmCALLER` is then written to the `xDomainMessageSender` state variable
- the call is then executed, allow the `target` to query the value of the `OVM_L1CrossDomainMessenger.xDomainMessageSender` for authorization.
- the call is then executed, allow the `target` to query the value of the `L1CrossDomainMessenger.xDomainMessageSender` for authorization.
- if it succeeds it is added to the `successfulMessages` and cannot be relayed again.
- regardless of success, an entry is written to the `relayedMessages` mapping.
**Then the receiver (ie. `SynthetixBridgeToOptimism`):**
- Checks that the caller is the `OVM_L1CrossDomainMessenger` and that the `xDomainMessageSender` is the `synthetixBridgeToBase` on L2.
- Checks that the caller is the `L1CrossDomainMessenger` and that the `xDomainMessageSender` is the `synthetixBridgeToBase` on L2.
## L1 to L2 messaging flow
......@@ -52,7 +52,7 @@ There are two 'low level' bridge contracts (the L1 and L2 Cross Domain Messenger
**Then on L2:**
- A transaction will be sent to the `OVM_L2CrossDomainMessenger`.
- The cross-domain message is deemed valid if the `ovmL1TXORIGIN` is the `OVM_L1CrossDomainMessenger`.
- The cross-domain message is deemed valid if the `ovmL1TXORIGIN` is the `L1CrossDomainMessenger`.
- If not valid, execution reverts.
- If the message is valid, the arguments are ABI encoded and keccak256 hashed to `xDomainCalldataHash`.
- The `succesfulMessages` mapping is checked to verify that `xDomainCalldataHash` has not already been executed successfully.
......@@ -61,5 +61,5 @@ There are two 'low level' bridge contracts (the L1 and L2 Cross Domain Messenger
- Execution reverts if the check fails.
- **Future note:** The `OVM_L2ToL1MessagePasser`, and this check should be removed, in favor of putting the `sentMessages` mapping into the L2xDM.
- The address of the L2 `ovmCALLER` is then written to the `xDomainMessageSender` state variable
- the call is then executed, allow the `target` to query the value of the `OVM_L1CrossDomainMessenger.xDomainMessageSender` for authorization.
- the call is then executed, allow the `target` to query the value of the `L1CrossDomainMessenger.xDomainMessageSender` for authorization.
- If it succeeds it is added to the `successfulMessages`.
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