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
99dc9a6b
Commit
99dc9a6b
authored
May 09, 2023
by
clabby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lint
parent
5edc0cfc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
message-utils.ts
packages/sdk/src/utils/message-utils.ts
+7
-3
No files found.
packages/sdk/src/utils/message-utils.ts
View file @
99dc9a6b
...
@@ -55,15 +55,19 @@ export const migratedWithdrawalGasLimit = (
...
@@ -55,15 +55,19 @@ export const migratedWithdrawalGasLimit = (
chainID
:
number
chainID
:
number
):
BigNumber
=>
{
):
BigNumber
=>
{
// Compute the gas limit and cap at 25 million
// Compute the gas limit and cap at 25 million
const
dataCost
=
BigNumber
.
from
(
hexDataLength
(
data
)).
mul
(
RELAY_PER_BYTE_DATA_COST
)
const
dataCost
=
BigNumber
.
from
(
hexDataLength
(
data
)).
mul
(
RELAY_PER_BYTE_DATA_COST
)
let
overhead
:
number
let
overhead
:
number
if
(
chainID
===
420
)
{
if
(
chainID
===
420
)
{
overhead
=
200
_000
overhead
=
200
_000
}
else
{
}
else
{
// Constant overhead
// Constant overhead
overhead
=
RELAY_CONSTANT_OVERHEAD
+
overhead
=
RELAY_CONSTANT_OVERHEAD
+
// Dynamic overhead (EIP-150)
// Dynamic overhead (EIP-150)
(
MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR
*
1
_000_000
)
/
MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR
+
(
MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR
*
1
_000_000
)
/
MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR
+
// Gas reserved for the worst-case cost of 3/5 of the `CALL` opcode's dynamic gas
// Gas reserved for the worst-case cost of 3/5 of the `CALL` opcode's dynamic gas
// factors. (Conservative)
// factors. (Conservative)
RELAY_CALL_OVERHEAD
+
RELAY_CALL_OVERHEAD
+
...
...
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