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
93f7f2b1
Unverified
Commit
93f7f2b1
authored
Aug 17, 2023
by
mergify[bot]
Committed by
GitHub
Aug 17, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into dependabot/npm_and_yarn/web3-eth-4.1.0
parents
31c3382b
26634b22
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
111 additions
and
69 deletions
+111
-69
wet-geese-cover.md
.changeset/wet-geese-cover.md
+0
-5
mergify.yml
.github/mergify.yml
+0
-8
config.go
indexer/config/config.go
+3
-0
sync_client.go
op-node/sources/sync_client.go
+3
-3
strategies.go
op-service/backoff/strategies.go
+14
-15
strategies_test.go
op-service/backoff/strategies_test.go
+4
-4
package.json
packages/common-ts/package.json
+1
-1
logger.ts
packages/common-ts/src/common/logger.ts
+1
-1
CHANGELOG.md
packages/web3js-plugin/CHANGELOG.md
+6
-0
package.json
packages/web3js-plugin/package.json
+1
-1
pnpm-lock.yaml
pnpm-lock.yaml
+78
-31
No files found.
.changeset/wet-geese-cover.md
deleted
100644 → 0
View file @
31c3382b
---
'
@eth-optimism/web3.js-plugin'
:
patch
---
Update code exmaples in README
.github/mergify.yml
View file @
93f7f2b1
...
@@ -321,11 +321,3 @@ pull_request_rules:
...
@@ -321,11 +321,3 @@ pull_request_rules:
label
:
label
:
add
:
add
:
-
M-ci
-
M-ci
-
name
:
Add M-bot label for bots
conditions
:
-
'
author=(github-actions|dependabot|)'
-
'
#label<5'
actions
:
label
:
add
:
-
M-bot
indexer/config/config.go
View file @
93f7f2b1
...
@@ -88,6 +88,7 @@ type MetricsConfig struct {
...
@@ -88,6 +88,7 @@ type MetricsConfig struct {
// LoadConfig loads the `indexer.toml` config file from a given path
// LoadConfig loads the `indexer.toml` config file from a given path
func
LoadConfig
(
logger
geth_log
.
Logger
,
path
string
)
(
Config
,
error
)
{
func
LoadConfig
(
logger
geth_log
.
Logger
,
path
string
)
(
Config
,
error
)
{
logger
.
Info
(
"Loading config file"
,
"path"
,
path
)
var
conf
Config
var
conf
Config
data
,
err
:=
os
.
ReadFile
(
path
)
data
,
err
:=
os
.
ReadFile
(
path
)
...
@@ -97,6 +98,8 @@ func LoadConfig(logger geth_log.Logger, path string) (Config, error) {
...
@@ -97,6 +98,8 @@ func LoadConfig(logger geth_log.Logger, path string) (Config, error) {
data
=
[]
byte
(
os
.
ExpandEnv
(
string
(
data
)))
data
=
[]
byte
(
os
.
ExpandEnv
(
string
(
data
)))
logger
.
Debug
(
"Decoding config file"
,
"data"
,
string
(
data
))
if
_
,
err
:=
toml
.
Decode
(
string
(
data
),
&
conf
);
err
!=
nil
{
if
_
,
err
:=
toml
.
Decode
(
string
(
data
),
&
conf
);
err
!=
nil
{
logger
.
Info
(
"Failed to decode config file"
,
"message"
,
err
)
logger
.
Info
(
"Failed to decode config file"
,
"message"
,
err
)
return
conf
,
err
return
conf
,
err
...
...
op-node/sources/sync_client.go
View file @
93f7f2b1
...
@@ -131,9 +131,9 @@ func (s *SyncClient) eventLoop() {
...
@@ -131,9 +131,9 @@ func (s *SyncClient) eventLoop() {
s
.
log
.
Info
(
"Starting sync client event loop"
)
s
.
log
.
Info
(
"Starting sync client event loop"
)
backoffStrategy
:=
&
backoff
.
ExponentialStrategy
{
backoffStrategy
:=
&
backoff
.
ExponentialStrategy
{
Min
:
1000
,
Min
:
1000
*
time
.
Millisecond
,
Max
:
20
_000
,
Max
:
20
_000
*
time
.
Millisecond
,
MaxJitter
:
250
,
MaxJitter
:
250
*
time
.
Millisecond
,
}
}
for
{
for
{
...
...
op-service/backoff/strategies.go
View file @
93f7f2b1
...
@@ -16,35 +16,34 @@ type Strategy interface {
...
@@ -16,35 +16,34 @@ type Strategy interface {
// ExponentialStrategy performs exponential backoff. The exponential backoff
// ExponentialStrategy performs exponential backoff. The exponential backoff
// function is min(e.Min + (2^attempt * 1000) + randBetween(0, e.MaxJitter), e.Max)
// function is min(e.Min + (2^attempt * 1000) + randBetween(0, e.MaxJitter), e.Max)
type
ExponentialStrategy
struct
{
type
ExponentialStrategy
struct
{
// Min is the minimum amount of time to wait between attempts
in ms
.
// Min is the minimum amount of time to wait between attempts.
Min
float64
Min
time
.
Duration
// Max is the maximum amount of time to wait between attempts
in ms
.
// Max is the maximum amount of time to wait between attempts.
Max
float64
Max
time
.
Duration
// MaxJitter is the maximum amount of random jitter to insert between
// MaxJitter is the maximum amount of random jitter to insert between attempts.
// attempts in ms.
MaxJitter
time
.
Duration
MaxJitter
int
}
}
func
(
e
*
ExponentialStrategy
)
Duration
(
attempt
int
)
time
.
Duration
{
func
(
e
*
ExponentialStrategy
)
Duration
(
attempt
int
)
time
.
Duration
{
var
jitter
int
var
jitter
time
.
Duration
if
e
.
MaxJitter
>
0
{
if
e
.
MaxJitter
>
0
{
jitter
=
rand
.
Intn
(
e
.
MaxJitter
)
jitter
=
time
.
Duration
(
rand
.
Int63n
(
e
.
MaxJitter
.
Nanoseconds
())
)
}
}
dur
:=
e
.
Min
+
(
math
.
Pow
(
2
,
float64
(
attempt
))
*
1000
)
dur
:=
e
.
Min
+
time
.
Duration
(
int
(
math
.
Pow
(
2
,
float64
(
attempt
))
*
1000
))
*
time
.
Millisecond
dur
+=
float64
(
jitter
)
dur
+=
jitter
if
dur
>
e
.
Max
{
if
dur
>
e
.
Max
{
return
time
.
Millisecond
*
time
.
Duration
(
e
.
Max
)
return
e
.
Max
}
}
return
time
.
Millisecond
*
time
.
Duration
(
dur
)
return
dur
}
}
func
Exponential
()
Strategy
{
func
Exponential
()
Strategy
{
return
&
ExponentialStrategy
{
return
&
ExponentialStrategy
{
Max
:
10000
,
Max
:
time
.
Duration
(
10000
*
time
.
Millisecond
)
,
MaxJitter
:
250
,
MaxJitter
:
time
.
Duration
(
250
*
time
.
Millisecond
)
,
}
}
}
}
...
...
op-service/backoff/strategies_test.go
View file @
93f7f2b1
...
@@ -9,13 +9,13 @@ import (
...
@@ -9,13 +9,13 @@ import (
func
TestExponential
(
t
*
testing
.
T
)
{
func
TestExponential
(
t
*
testing
.
T
)
{
strategy
:=
&
ExponentialStrategy
{
strategy
:=
&
ExponentialStrategy
{
Min
:
3000
,
Min
:
3000
*
time
.
Millisecond
,
Max
:
10000
,
Max
:
10000
*
time
.
Millisecond
,
MaxJitter
:
0
,
MaxJitter
:
0
,
}
}
durations
:=
[]
int
{
4
,
5
,
7
,
10
,
10
}
durations
:=
[]
time
.
Duration
{
4
,
5
,
7
,
10
,
10
}
for
i
,
dur
:=
range
durations
{
for
i
,
dur
:=
range
durations
{
require
.
Equal
(
t
,
time
.
Millisecond
*
time
.
Duration
(
dur
*
1000
)
,
strategy
.
Duration
(
i
))
require
.
Equal
(
t
,
dur
*
time
.
Second
,
strategy
.
Duration
(
i
))
}
}
}
}
packages/common-ts/package.json
View file @
93f7f2b1
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
"express-prom-bundle"
:
"^6.4.1"
,
"express-prom-bundle"
:
"^6.4.1"
,
"lodash"
:
"^4.17.21"
,
"lodash"
:
"^4.17.21"
,
"morgan"
:
"^1.10.0"
,
"morgan"
:
"^1.10.0"
,
"pino"
:
"^
6.11.3
"
,
"pino"
:
"^
8.15.0
"
,
"pino-multi-stream"
:
"^5.3.0"
,
"pino-multi-stream"
:
"^5.3.0"
,
"pino-sentry"
:
"^0.14.0"
,
"pino-sentry"
:
"^0.14.0"
,
"prom-client"
:
"^13.1.0"
"prom-client"
:
"^13.1.0"
...
...
packages/common-ts/src/common/logger.ts
View file @
93f7f2b1
...
@@ -11,7 +11,7 @@ export const logLevels = [
...
@@ -11,7 +11,7 @@ export const logLevels = [
'
error
'
,
'
error
'
,
'
fatal
'
,
'
fatal
'
,
]
as
const
]
as
const
export
type
LogLevel
=
typeof
logLevels
[
number
]
export
type
LogLevel
=
(
typeof
logLevels
)
[
number
]
export
interface
LoggerOptions
{
export
interface
LoggerOptions
{
name
:
string
name
:
string
...
...
packages/web3js-plugin/CHANGELOG.md
View file @
93f7f2b1
# @eth-optimism/web3.js-plugin
# @eth-optimism/web3.js-plugin
## 0.1.2
### Patch Changes
-
[
#6873
](
https://github.com/ethereum-optimism/optimism/pull/6873
)
[
`fdab6caa7`
]
(https://github.com/ethereum-optimism/optimism/commit/fdab6caa7e6684b08882d2a766ccd727068c2b2f) Thanks
[
@spacesailor24
](
https://github.com/spacesailor24
)
! - Update code exmaples in README
## 0.1.1
## 0.1.1
### Patch Changes
### Patch Changes
...
...
packages/web3js-plugin/package.json
View file @
93f7f2b1
{
{
"name"
:
"@eth-optimism/web3.js-plugin"
,
"name"
:
"@eth-optimism/web3.js-plugin"
,
"version"
:
"0.1.
1
"
,
"version"
:
"0.1.
2
"
,
"description"
:
"A Web3.js plugin for doing OP-Chain gas estimation"
,
"description"
:
"A Web3.js plugin for doing OP-Chain gas estimation"
,
"license"
:
"MIT"
,
"license"
:
"MIT"
,
"repository"
:
{
"repository"
:
{
...
...
pnpm-lock.yaml
View file @
93f7f2b1
This diff is collapsed.
Click to expand it.
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