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
6112b7aa
Unverified
Commit
6112b7aa
authored
Jul 09, 2021
by
Mark Tyneway
Committed by
GitHub
Jul 09, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1255 from ethereum-optimism/gas-oracle/logging
gas-oracle: improve logging
parents
6ede0241
8c4f479c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
kind-hotels-turn.md
.changeset/kind-hotels-turn.md
+5
-0
l2_gas_pricer.go
go/gas-oracle/gasprices/l2_gas_pricer.go
+6
-2
No files found.
.changeset/kind-hotels-turn.md
0 → 100644
View file @
6112b7aa
---
'
@eth-optimism/gas-oracle'
:
patch
---
Add additional logging in the
`gas-oracle`
go/gas-oracle/gasprices/l2_gas_pricer.go
View file @
6112b7aa
...
@@ -52,6 +52,8 @@ func (p *GasPricer) CalcNextEpochGasPrice(avgGasPerSecondLastEpoch float64) (uin
...
@@ -52,6 +52,8 @@ func (p *GasPricer) CalcNextEpochGasPrice(avgGasPerSecondLastEpoch float64) (uin
}
}
// The percent difference between our current average gas & our target gas
// The percent difference between our current average gas & our target gas
proportionOfTarget
:=
avgGasPerSecondLastEpoch
/
targetGasPerSecond
proportionOfTarget
:=
avgGasPerSecondLastEpoch
/
targetGasPerSecond
log
.
Trace
(
"Calculating next epoch gas price"
,
"proportionOfTarget"
,
proportionOfTarget
,
"avgGasPerSecondLastEpoch"
,
avgGasPerSecondLastEpoch
,
"targetGasPerSecond"
,
targetGasPerSecond
)
// The percent that we should adjust the gas price to reach our target gas
// The percent that we should adjust the gas price to reach our target gas
proportionToChangeBy
:=
0.0
proportionToChangeBy
:=
0.0
if
proportionOfTarget
>=
1
{
// If average avgGasPerSecondLastEpoch is GREATER than our target
if
proportionOfTarget
>=
1
{
// If average avgGasPerSecondLastEpoch is GREATER than our target
...
@@ -59,9 +61,11 @@ func (p *GasPricer) CalcNextEpochGasPrice(avgGasPerSecondLastEpoch float64) (uin
...
@@ -59,9 +61,11 @@ func (p *GasPricer) CalcNextEpochGasPrice(avgGasPerSecondLastEpoch float64) (uin
}
else
{
}
else
{
proportionToChangeBy
=
math
.
Max
(
proportionOfTarget
,
1
-
p
.
maxChangePerEpoch
)
proportionToChangeBy
=
math
.
Max
(
proportionOfTarget
,
1
-
p
.
maxChangePerEpoch
)
}
}
log
.
Debug
(
"CalcNextEpochGasPrice"
,
"proportionToChangeBy"
,
proportionToChangeBy
,
"proportionOfTarget"
,
proportionOfTarget
)
updated
:=
float64
(
max
(
1
,
p
.
curPrice
))
*
proportionToChangeBy
updated
:=
float64
(
max
(
1
,
p
.
curPrice
))
*
proportionToChangeBy
return
max
(
p
.
floorPrice
,
uint64
(
math
.
Ceil
(
updated
))),
nil
result
:=
max
(
p
.
floorPrice
,
uint64
(
math
.
Ceil
(
updated
)))
log
.
Debug
(
"Calculated next epoch gas price"
,
"proportionToChangeBy"
,
proportionToChangeBy
,
"proportionOfTarget"
,
proportionOfTarget
,
"result"
,
result
)
return
result
,
nil
}
}
// CompleteEpoch ends the current epoch and updates the current gas price for the next epoch
// CompleteEpoch ends the current epoch and updates the current gas price for the next epoch
...
...
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