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
fb5df373
Unverified
Commit
fb5df373
authored
Oct 01, 2021
by
Maurelian
Committed by
Kelvin Fichter
Nov 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(contracts): combine two mappings into one with a struct
parent
5db50b3d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
CanonicalTransactionChain.sol
...ntracts/contracts/L1/rollup/CanonicalTransactionChain.sol
+1
-1
CanonicalTransactionChain.gas.spec.ts
...contracts/L1/rollup/CanonicalTransactionChain.gas.spec.ts
+3
-3
No files found.
packages/contracts/contracts/L1/rollup/CanonicalTransactionChain.sol
View file @
fb5df373
...
@@ -229,7 +229,7 @@ contract CanonicalTransactionChain is ICanonicalTransactionChain, Lib_AddressRes
...
@@ -229,7 +229,7 @@ contract CanonicalTransactionChain is ICanonicalTransactionChain, Lib_AddressRes
uint40
uint40
)
)
{
{
return uint40(
transactionHashe
s.length);
return uint40(
queueElement
s.length);
}
}
/**
/**
...
...
packages/contracts/test/contracts/L1/rollup/CanonicalTransactionChain.gas.spec.ts
View file @
fb5df373
...
@@ -218,7 +218,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => {
...
@@ -218,7 +218,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => {
'
Non-calldata overhead gas cost per transaction:
'
,
'
Non-calldata overhead gas cost per transaction:
'
,
(
gasUsed
-
fixedCalldataCost
)
/
numTxs
(
gasUsed
-
fixedCalldataCost
)
/
numTxs
)
)
expectApprox
(
gasUsed
,
1
_61
7_3
81
,
{
expectApprox
(
gasUsed
,
1
_61
9_7
81
,
{
absoluteUpperDeviation
:
1000
,
absoluteUpperDeviation
:
1000
,
// Assert a lower bound of 1% reduction on gas cost. If your tests are breaking because your
// Assert a lower bound of 1% reduction on gas cost. If your tests are breaking because your
// contracts are too efficient, consider updating the target value!
// contracts are too efficient, consider updating the target value!
...
@@ -309,7 +309,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => {
...
@@ -309,7 +309,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => {
console
.
log
(
'
Benchmark complete.
'
)
console
.
log
(
'
Benchmark complete.
'
)
printGasSavings
(
gasUsed
,
237
_065
)
printGasSavings
(
gasUsed
,
237
_065
)
expectApprox
(
gasUsed
,
206
_880
,
{
expectApprox
(
gasUsed
,
187
_081
,
{
absoluteUpperDeviation
:
500
,
absoluteUpperDeviation
:
500
,
// Assert a lower bound of 1% reduction on gas cost. If your tests are breaking because your
// Assert a lower bound of 1% reduction on gas cost. If your tests are breaking because your
// contracts are too efficient, consider updating the target value!
// contracts are too efficient, consider updating the target value!
...
@@ -331,7 +331,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => {
...
@@ -331,7 +331,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => {
console
.
log
(
'
Benchmark complete.
'
)
console
.
log
(
'
Benchmark complete.
'
)
printGasSavings
(
gasUsed
,
196
_457
)
printGasSavings
(
gasUsed
,
196
_457
)
expectApprox
(
gasUsed
,
1
46
_499
,
{
expectApprox
(
gasUsed
,
1
26
_700
,
{
absoluteUpperDeviation
:
500
,
absoluteUpperDeviation
:
500
,
// Assert a lower bound of 1% reduction on gas cost. If your tests are breaking because your
// Assert a lower bound of 1% reduction on gas cost. If your tests are breaking because your
// contracts are too efficient, consider updating the target value!
// contracts are too efficient, consider updating the target value!
...
...
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