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
8ca1e008
Unverified
Commit
8ca1e008
authored
Oct 01, 2021
by
Kelvin Fichter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: remove onlyRelayer modifier
parent
b70ee70c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
56 deletions
+5
-56
L1CrossDomainMessenger.sol
...ntracts/contracts/L1/messaging/L1CrossDomainMessenger.sol
+5
-26
L1CrossDomainMessenger.spec.ts
...est/contracts/L1/messaging/L1CrossDomainMessenger.spec.ts
+0
-16
service.ts
packages/message-relayer/src/service.ts
+0
-14
No files found.
packages/contracts/contracts/L1/messaging/L1CrossDomainMessenger.sol
View file @
8ca1e008
...
@@ -33,11 +33,11 @@ import { ReentrancyGuardUpgradeable } from
...
@@ -33,11 +33,11 @@ import { ReentrancyGuardUpgradeable } from
* Runtime target: EVM
* Runtime target: EVM
*/
*/
contract L1CrossDomainMessenger is
contract L1CrossDomainMessenger is
IL1CrossDomainMessenger,
IL1CrossDomainMessenger,
Lib_AddressResolver,
Lib_AddressResolver,
OwnableUpgradeable,
OwnableUpgradeable,
PausableUpgradeable,
PausableUpgradeable,
ReentrancyGuardUpgradeable
ReentrancyGuardUpgradeable
{
{
/**********
/**********
...
@@ -78,26 +78,6 @@ contract L1CrossDomainMessenger is
...
@@ -78,26 +78,6 @@ contract L1CrossDomainMessenger is
{}
{}
/**********************
* Function Modifiers *
**********************/
/**
* Modifier to enforce that, if configured, only the OVM_L2MessageRelayer contract may
* successfully call a method.
*/
modifier onlyRelayer() {
address relayer = resolve("OVM_L2MessageRelayer");
if (relayer != address(0)) {
require(
msg.sender == relayer,
"Only OVM_L2MessageRelayer can relay L2-to-L1 messages."
);
}
_;
}
/********************
/********************
* Public Functions *
* Public Functions *
********************/
********************/
...
@@ -221,7 +201,6 @@ contract L1CrossDomainMessenger is
...
@@ -221,7 +201,6 @@ contract L1CrossDomainMessenger is
)
)
public
public
nonReentrant
nonReentrant
onlyRelayer
whenNotPaused
whenNotPaused
{
{
bytes memory xDomainCalldata = Lib_CrossDomainUtils.encodeXDomainCalldata(
bytes memory xDomainCalldata = Lib_CrossDomainUtils.encodeXDomainCalldata(
...
...
packages/contracts/test/contracts/L1/messaging/L1CrossDomainMessenger.spec.ts
View file @
8ca1e008
...
@@ -521,21 +521,5 @@ describe('L1CrossDomainMessenger', () => {
...
@@ -521,21 +521,5 @@ describe('L1CrossDomainMessenger', () => {
).
to
.
not
.
be
.
reverted
).
to
.
not
.
be
.
reverted
})
})
})
})
describe
(
'
onlyRelayer
'
,
()
=>
{
it
(
'
when the OVM_L2MessageRelayer address is set, should revert if called by a different account
'
,
async
()
=>
{
// set to a random NON-ZERO address
await
AddressManager
.
setAddress
(
'
OVM_L2MessageRelayer
'
,
'
0x1234123412341234123412341234123412341234
'
)
await
expect
(
L1CrossDomainMessenger
.
relayMessage
(
target
,
sender
,
message
,
0
,
proof
)
).
to
.
be
.
revertedWith
(
'
Only OVM_L2MessageRelayer can relay L2-to-L1 messages.
'
)
})
})
})
})
})
})
packages/message-relayer/src/service.ts
View file @
8ca1e008
...
@@ -154,20 +154,6 @@ export class MessageRelayerService extends BaseService<MessageRelayerOptions> {
...
@@ -154,20 +154,6 @@ export class MessageRelayerService extends BaseService<MessageRelayerOptions> {
await
sleep
(
this
.
options
.
pollingInterval
)
await
sleep
(
this
.
options
.
pollingInterval
)
try
{
try
{
// Check that the correct address is set in the address manager
const
relayer
=
await
this
.
state
.
Lib_AddressManager
.
getAddress
(
'
OVM_L2MessageRelayer
'
)
// If it is address(0), then message relaying is not authenticated
if
(
relayer
!==
ethers
.
constants
.
AddressZero
)
{
const
address
=
await
this
.
options
.
l1Wallet
.
getAddress
()
if
(
relayer
!==
address
)
{
throw
new
Error
(
`OVM_L2MessageRelayer (
${
relayer
}
) is not set to message-passer EOA
${
address
}
`
)
}
}
this
.
logger
.
info
(
'
Checking for newly finalized transactions...
'
)
this
.
logger
.
info
(
'
Checking for newly finalized transactions...
'
)
if
(
if
(
!
(
await
this
.
_isTransactionFinalized
(
!
(
await
this
.
_isTransactionFinalized
(
...
...
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