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
d2951a33
Commit
d2951a33
authored
May 09, 2023
by
clabby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
`number` -> `BigNumber`
parent
99dc9a6b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
message-utils.ts
packages/sdk/src/utils/message-utils.ts
+16
-15
No files found.
packages/sdk/src/utils/message-utils.ts
View file @
d2951a33
...
@@ -58,25 +58,26 @@ export const migratedWithdrawalGasLimit = (
...
@@ -58,25 +58,26 @@ export const migratedWithdrawalGasLimit = (
const
dataCost
=
BigNumber
.
from
(
hexDataLength
(
data
)).
mul
(
const
dataCost
=
BigNumber
.
from
(
hexDataLength
(
data
)).
mul
(
RELAY_PER_BYTE_DATA_COST
RELAY_PER_BYTE_DATA_COST
)
)
let
overhead
:
n
umber
let
overhead
:
BigN
umber
if
(
chainID
===
420
)
{
if
(
chainID
===
420
)
{
overhead
=
200
_000
overhead
=
BigNumber
.
from
(
200
_000
)
}
else
{
}
else
{
// Constant overhead
// Constant overhead
overhead
=
overhead
=
BigNumber
.
from
(
RELAY_CONSTANT_OVERHEAD
+
RELAY_CONSTANT_OVERHEAD
+
// Dynamic overhead (EIP-150)
// Dynamic overhead (EIP-150)
(
MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR
*
1
_000_000
)
/
(
MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR
*
1
_000_000
)
/
MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR
+
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
+
// Relay reserved gas (to ensure execution of `relayMessage` completes after the
// Relay reserved gas (to ensure execution of `relayMessage` completes after the
// subcontext finishes executing) (Conservative)
// subcontext finishes executing) (Conservative)
RELAY_RESERVED_GAS
+
RELAY_RESERVED_GAS
+
// Gas reserved for the execution between the `hasMinGas` check and the `CALL`
// Gas reserved for the execution between the `hasMinGas` check and the `CALL`
// opcode. (Conservative)
// opcode. (Conservative)
RELAY_GAS_CHECK_BUFFER
RELAY_GAS_CHECK_BUFFER
)
}
}
let
minGasLimit
=
dataCost
.
add
(
overhead
)
let
minGasLimit
=
dataCost
.
add
(
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