Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge/v0.2.5 #2413

Merged
merged 80 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
2ef0c25
fix null effective_percentage
ToniRamirezM Jun 30, 2023
7980151
fix forkID calculation
ToniRamirezM Jun 30, 2023
224a11e
fix script
ToniRamirezM Jun 30, 2023
13bcd29
generate json-schema + docs for node config file and network_custom
joanestebanr Jul 4, 2023
41c63ab
fix unittest
joanestebanr Jul 5, 2023
5a85d85
Hotfixv0.1.4 to v0.2.0 (#2255)
ARR552 Jul 5, 2023
d055c40
Effective GasPrice refactor+fixes (#2247)
agnusmor Jul 5, 2023
76dc7d5
Fix/#2257 effective gas price receipt (#2258)
ARR552 Jul 5, 2023
87200f1
bugfix: fixing l2blocks timestamp for the fist batch (#2260)
ARR552 Jul 5, 2023
9f39433
add more comments, and removed fields PrivateKeyPath and PrivateKeyPa…
joanestebanr Jul 6, 2023
b21258d
add info to git action
joanestebanr Jul 6, 2023
7197f4e
add info to git action
joanestebanr Jul 6, 2023
7e3d34d
fix github action
joanestebanr Jul 6, 2023
8566eed
Merge remote-tracking branch 'origin/develop' into feature/#2200-add-…
joanestebanr Jul 7, 2023
b6e034f
updated comments
joanestebanr Jul 7, 2023
71541ee
updated comments
joanestebanr Jul 7, 2023
623089a
Fix/#2263 gas used (#2264)
ARR552 Jul 10, 2023
9d03f8b
Fix pending tx when duplicate nonce (#2270)
agnusmor Jul 10, 2023
40b084b
Only return a tx from the pool if tx is in pending status (#2273)
ARR552 Jul 10, 2023
17a95f5
Merge pull request #2252 from 0xPolygonHermez/feature/#2200-add-docum…
joanestebanr Jul 11, 2023
867aaaf
fix documentation with config file
joanestebanr Jul 11, 2023
198243a
improve: adding check to skip appending effectivePercentage if curren…
Psykepro Jul 11, 2023
c00e4fa
Merge pull request #2275 from 0xPolygonHermez/improve/add-check-for-f…
Psykepro Jul 11, 2023
861dbba
Fiex effectiveGasprice unsigned txs with forkId lower than 5 (#2278)
ARR552 Jul 11, 2023
e7e9f5b
feat: adding functionality to stop sequencer on specific batch num fr…
Psykepro Jul 12, 2023
caa9a3a
Merge pull request #2282 from 0xPolygonHermez/feature/stop-sequencer-…
Psykepro Jul 13, 2023
a4d0b88
patch: adding print for X-Real-IP in JSON-RPC
Psykepro Jul 14, 2023
32bf764
Fix checkIfSynced (#2289)
ARR552 Jul 14, 2023
b5d5145
[Rehashing] Check logs order and fix blockhash and blockNumber in the…
ARR552 Jul 14, 2023
2b1ea5f
Merge pull request #2286 from 0xPolygonHermez/patch/add-print-for-X-R…
Psykepro Jul 14, 2023
e314df2
flushID synchronizer (#2287)
ARR552 Jul 14, 2023
c9b4057
executor error refactor (#2299)
ToniRamirezM Jul 19, 2023
80c471d
handle invalid rlp ROM error (#2297)
ToniRamirezM Jul 19, 2023
13cafe2
add maxL2GasPrice (#2294)
ToniRamirezM Jul 19, 2023
c761cea
Error refactor (#2302)
ToniRamirezM Jul 19, 2023
9b409e4
Fix replaced tx as failed when duplicated nonce (#2308)
agnusmor Jul 20, 2023
31eb8a4
log reprocess need (#2309)
ToniRamirezM Jul 20, 2023
978e77b
Feature/2300 synchronizer detect if executor restart (#2306)
joanestebanr Jul 21, 2023
a814dc0
Update prover images (#2311)
ToniRamirezM Jul 21, 2023
c66222f
add doc, and fix dockers to be able to use snap/restore feature (#2315)
joanestebanr Jul 21, 2023
2da46fd
Update docker-compose.yml
ToniRamirezM Jul 21, 2023
6fd4c75
Update docker-compose.yml
ToniRamirezM Jul 21, 2023
44356c8
do not add tx to the pool in case err != nil
ToniRamirezM Jul 26, 2023
822858c
do not add tx into the pool if a fatal error in the executor happens …
ToniRamirezM Jul 26, 2023
7d10f46
fix dbMultiWriteSinglePosition config value
tclemos Jul 27, 2023
6a6fc6f
workarround for the error error closing batch
joanestebanr Jul 28, 2023
d6aa5e0
workarround for the error error closing batch
joanestebanr Jul 28, 2023
203751a
workarround for the error error closing batch
joanestebanr Jul 28, 2023
d0e95a8
workaround for the error of closing batch, another case
joanestebanr Jul 28, 2023
38a97f0
`Worker`'s `AddTxTracker` Bug Fix (#2343)
Psykepro Jul 31, 2023
80c8f20
rename config files (#2349)
ToniRamirezM Aug 1, 2023
1389c6b
fix closing batch + logs (#2348)
ARR552 Aug 1, 2023
c99bc9f
Update README.md
ToniRamirezM Aug 1, 2023
7036565
Update release.yml
ToniRamirezM Aug 1, 2023
4806b58
bugfix: fixing place where we need to increment the wg per address fo…
Psykepro Aug 2, 2023
dce5cd0
Merge pull request #2356 from 0xPolygonHermez/bufix/worker-addrqueue-…
Psykepro Aug 2, 2023
2298c8f
Store batchL2Data when the batch is opened (#2358)
ARR552 Aug 3, 2023
24cbf1a
add GasPriceMarginFactor and MaxGasPrice to eth-tx-manager (#2360)
tclemos Aug 3, 2023
9c32934
bugfix: attaching missing TxTracker.From to pending txs to store for …
Psykepro Aug 3, 2023
de6206f
Update README.md
ToniRamirezM Aug 3, 2023
8ec1474
improve: adding logs (#2373)
Psykepro Aug 4, 2023
e15805d
bugfix: fixing finalizer's handling. (#2375)
Psykepro Aug 4, 2023
ca3cc9d
Update README.md
ToniRamirezM Aug 4, 2023
81a6bf6
change hashdb go package
ToniRamirezM Aug 3, 2023
901466f
new hashdb interface
ToniRamirezM Aug 3, 2023
8275016
aggregator pb refactor
ToniRamirezM Aug 3, 2023
9a5b26e
new prover image
ToniRamirezM Aug 3, 2023
6dffbfb
change prover config
ToniRamirezM Aug 3, 2023
4dcd6b0
update prover image
ToniRamirezM Aug 3, 2023
c53d87a
update to latest proto and prover image
ToniRamirezM Aug 5, 2023
8d4ba17
Refactor nonce calculation for addQueue (#2382)
ToniRamirezM Aug 7, 2023
23f4290
fix script
ToniRamirezM Aug 7, 2023
c05398c
check to avoid data inconsistencies (#2387)
ARR552 Aug 8, 2023
8848855
Refactor: avoid delete addrQueue if it has pending txs to store (#2391)
agnusmor Aug 9, 2023
5784aea
Sort txs in worker by gasPrice (remove efficiency sort) (#2392)
agnusmor Aug 9, 2023
072be43
use useMainExecGenerated (#2393)
ToniRamirezM Aug 9, 2023
b4e9dfb
Fix store forced batch tx (#2394)
agnusmor Aug 9, 2023
f041a1b
l2coinbase (#2400)
ARR552 Aug 11, 2023
9ff547c
merge v0.2.5 into develop
ToniRamirezM Aug 16, 2023
e5f954f
merge v0.2.5 into develop
ToniRamirezM Aug 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,12 +396,11 @@ func createSequenceSender(cfg config.Config, pool *pool.Pool, etmStorage *ethtxm
log.Fatal(err)
}

for _, privateKey := range cfg.SequenceSender.PrivateKeys {
_, err := etherman.LoadAuthFromKeyStore(privateKey.Path, privateKey.Password)
if err != nil {
log.Fatal(err)
}
auth, err := etherman.LoadAuthFromKeyStore(cfg.SequenceSender.PrivateKey.Path, cfg.SequenceSender.PrivateKey.Password)
if err != nil {
log.Fatal(err)
}
cfg.SequenceSender.SenderAddress = auth.From

cfg.SequenceSender.ForkUpgradeBatchNumber = cfg.ForkUpgradeBatchNumber

Expand Down
40 changes: 0 additions & 40 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,42 +100,6 @@ func Test_Defaults(t *testing.T) {
path: "Sequencer.MaxTxLifetime",
expectedValue: types.NewDuration(3 * time.Hour),
},
{
path: "Sequencer.WeightBatchBytesSize",
expectedValue: 1,
},
{
path: "Sequencer.WeightCumulativeGasUsed",
expectedValue: 1,
},
{
path: "Sequencer.WeightKeccakHashes",
expectedValue: 1,
},
{
path: "Sequencer.WeightPoseidonHashes",
expectedValue: 1,
},
{
path: "Sequencer.WeightPoseidonPaddings",
expectedValue: 1,
},
{
path: "Sequencer.WeightMemAligns",
expectedValue: 1,
},
{
path: "Sequencer.WeightArithmetics",
expectedValue: 1,
},
{
path: "Sequencer.WeightBinaries",
expectedValue: 1,
},
{
path: "Sequencer.WeightSteps",
expectedValue: 1,
},
{
path: "Sequencer.Finalizer.GERDeadlineTimeout",
expectedValue: types.NewDuration(5 * time.Second),
Expand Down Expand Up @@ -208,10 +172,6 @@ func Test_Defaults(t *testing.T) {
path: "Sequencer.DBManager.L2ReorgRetrievalInterval",
expectedValue: types.NewDuration(5 * time.Second),
},
{
path: "Sequencer.Worker.ResourceCostMultiplier",
expectedValue: float64(1000),
},
{
path: "SequenceSender.WaitPeriodSendSequence",
expectedValue: types.NewDuration(5 * time.Second),
Expand Down
15 changes: 2 additions & 13 deletions config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,6 @@ MaxMemAligns = 236585
MaxArithmetics = 236585
MaxBinaries = 473170
MaxSteps = 7570538
WeightBatchBytesSize = 1
WeightCumulativeGasUsed = 1
WeightKeccakHashes = 1
WeightPoseidonHashes = 1
WeightPoseidonPaddings = 1
WeightMemAligns = 1
WeightArithmetics = 1
WeightBinaries = 1
WeightSteps = 1
TxLifetimeCheckTimeout = "10m"
MaxTxLifetime = "3h"
[Sequencer.Finalizer]
Expand All @@ -111,8 +102,6 @@ MaxTxLifetime = "3h"
[Sequencer.DBManager]
PoolRetrievalInterval = "500ms"
L2ReorgRetrievalInterval = "5s"
[Sequencer.Worker]
ResourceCostMultiplier = 1000
[Sequencer.EffectiveGasPrice]
MaxBreakEvenGasPriceDeviationPercentage = 10
L1GasPriceFactor = 0.25
Expand All @@ -124,8 +113,8 @@ MaxTxLifetime = "3h"
WaitPeriodSendSequence = "5s"
LastBatchVirtualizationTimeMaxWaitPeriod = "5s"
MaxTxSizeForL1 = 131072
SenderAddress = "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
PrivateKeys = [{Path = "/pk/sequencer.keystore", Password = "testonly"}]
L2Coinbase = "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
PrivateKey = {Path = "/pk/sequencer.keystore", Password = "testonly"}

[Aggregator]
Host = "0.0.0.0"
Expand Down
15 changes: 2 additions & 13 deletions config/environments/local/local.node.config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,6 @@ MaxMemAligns = 236585
MaxArithmetics = 236585
MaxBinaries = 473170
MaxSteps = 7570538
WeightBatchBytesSize = 1
WeightCumulativeGasUsed = 1
WeightKeccakHashes = 1
WeightPoseidonHashes = 1
WeightPoseidonPaddings = 1
WeightMemAligns = 1
WeightArithmetics = 1
WeightBinaries = 1
WeightSteps = 1
TxLifetimeCheckTimeout = "10m"
MaxTxLifetime = "3h"
[Sequencer.Finalizer]
Expand All @@ -95,8 +86,6 @@ MaxTxLifetime = "3h"
[Sequencer.DBManager]
PoolRetrievalInterval = "500ms"
L2ReorgRetrievalInterval = "5s"
[Sequencer.Worker]
ResourceCostMultiplier = 1000
[Sequencer.EffectiveGasPrice]
MaxBreakEvenGasPriceDeviationPercentage = 10
L1GasPriceFactor = 0.25
Expand All @@ -108,8 +97,8 @@ MaxTxLifetime = "3h"
WaitPeriodSendSequence = "5s"
LastBatchVirtualizationTimeMaxWaitPeriod = "5s"
MaxTxSizeForL1 = 131072
SenderAddress = "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
PrivateKeys = [{Path = "/pk/sequencer.keystore", Password = "testonly"}]
L2Coinbase = "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
PrivateKey = {Path = "/pk/sequencer.keystore", Password = "testonly"}

[Aggregator]
Host = "0.0.0.0"
Expand Down
2 changes: 1 addition & 1 deletion config/environments/mainnet/prover.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"runBlakeTest": false,

"executeInParallel": true,
"useMainExecGenerated": false,
"useMainExecGenerated": true,
"saveRequestToFile": false,
"saveInputToFile": false,
"saveDbReadsToFile": false,
Expand Down
2 changes: 1 addition & 1 deletion config/environments/testnet/prover.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"runBlakeTest": false,

"executeInParallel": true,
"useMainExecGenerated": false,
"useMainExecGenerated": true,
"saveRequestToFile": false,
"saveInputToFile": false,
"saveDbReadsToFile": false,
Expand Down
16 changes: 13 additions & 3 deletions config/gen_json_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"reflect"

"github.com/0xPolygonHermez/zkevm-node/config/types"
"github.com/0xPolygonHermez/zkevm-node/log"
"github.com/ethereum/go-ethereum/common"
"github.com/invopop/jsonschema"
"github.com/urfave/cli/v2"
)
Expand Down Expand Up @@ -200,16 +202,24 @@ func fillDefaultValuesPartial(schema *jsonschema.Schema, default_config interfac
return
}
for _, key := range schema.Properties.Keys() {
log.Debugf("fillDefaultValuesPartial: key: %s", key)
value, ok := schema.Properties.Get(key)
if ok {
value_schema, _ := value.(*jsonschema.Schema)
default_value := getValueFromStruct(default_config, key)
if default_value.IsValid() && variantFieldIsSet(&value_schema.Default) {
switch value_schema.Type {
case "array":
if !default_value.IsZero() && !default_value.IsNil() {
def_value := default_value.Interface()
value_schema.Default = def_value
if default_value.Kind() == reflect.ValueOf(common.Address{}).Kind() {
if !default_value.IsZero() {
def_value := default_value.Interface()
value_schema.Default = def_value
}
} else {
if !default_value.IsZero() && !default_value.IsNil() {
def_value := default_value.Interface()
value_schema.Default = def_value
}
}
case "object":
fillDefaultValuesPartial(value_schema, default_value.Interface())
Expand Down
38 changes: 38 additions & 0 deletions config/gen_json_schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ import (
"time"

"github.com/0xPolygonHermez/zkevm-node/config/types"
"github.com/ethereum/go-ethereum/common"
"github.com/invopop/jsonschema"
"github.com/mitchellh/mapstructure"
"github.com/spf13/viper"
"github.com/stretchr/testify/require"
"github.com/urfave/cli/v2"
)

type TestConfigWithAddress struct {
L2Coinbase common.Address `mapstructure:"L2Coinbase"`
}

type MySectionConfig struct {
}

Expand Down Expand Up @@ -85,6 +90,39 @@ f1_another_name="value_f1"
f2_another_name=5678
`

func TestGenerateJsonSchemaWithAEthAddressEmpty(t *testing.T) {
cli := cli.NewContext(nil, nil, nil)
generator := ConfigJsonSchemaGenerater[TestConfigWithAddress]{
repoName: "github.com/0xPolygonHermez/zkevm-node/config/",
cleanRequiredField: true,
addCodeCommentsToSchema: true,
pathSourceCode: "./",
repoNameSuffix: "config/",
defaultValues: &TestConfigWithAddress{},
}
schema, err := generator.GenerateJsonSchema(cli)
require.NoError(t, err)
require.NotNil(t, schema)
}

func TestGenerateJsonSchemaWithAEthAddress(t *testing.T) {
cli := cli.NewContext(nil, nil, nil)
adr := common.HexToAddress("0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266")
generator := ConfigJsonSchemaGenerater[TestConfigWithAddress]{
repoName: "github.com/0xPolygonHermez/zkevm-node/config/",
cleanRequiredField: true,
addCodeCommentsToSchema: true,
pathSourceCode: "./",
repoNameSuffix: "config/",
defaultValues: &TestConfigWithAddress{
L2Coinbase: adr,
},
}
schema, err := generator.GenerateJsonSchema(cli)
require.NoError(t, err)
require.NotNil(t, schema)
}

func TestGenerateJsonSchemaCommentsWithDurationItem(t *testing.T) {
cli := cli.NewContext(nil, nil, nil)
duration, err := time.ParseDuration("1m")
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ services:
zkevm-prover:
container_name: zkevm-prover
restart: unless-stopped
image: hermeznetwork/zkevm-prover:v2.1.0-RC2
image: hermeznetwork/zkevm-prover:v2.1.0
depends_on:
zkevm-state-db:
condition: service_healthy
Expand Down
Loading