Skip to content

Commit

Permalink
[R4R]-{main}: release/v0.4.3 into main (#1353)
Browse files Browse the repository at this point in the history
# Goals of PR

Core changes:
merge release v0.4.3 into main

Notes:
no

Related Issues:
no
  • Loading branch information
Sha3nS authored Aug 16, 2023
2 parents 39125d6 + 8b91d7f commit 5cda5f8
Show file tree
Hide file tree
Showing 33 changed files with 486 additions and 400 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ ops/data/**
dist/
packages/contracts/test/data/
packages/contracts/abi/
gas-oracle/gas-oracle-data/
53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,58 @@
# Changelog

## [v0.4.3](https://github.com/mantlenetworkio/mantle/commits/v0.4.3) - 2023-08-16

### Features
- DA
- Added DA license([#1263](https://github.com/mantlenetworkio/mantle/pull/1263))
- RollUp Service
- Optimized the rollup service([#1301](https://github.com/mantlenetworkio/mantle/pull/1301))
- Log optimization for mt-batcher and da-retriever([#1329](https://github.com/mantlenetworkio/mantle/pull/1329))
- Modified for Rollup services optimization code([#1334](https://github.com/mantlenetworkio/mantle/pull/1334))
- SDK
- Updated @mantleio/sdk to version 0.2.2([#1349](https://github.com/mantlenetworkio/mantle/pull/1349))

### Bug Fixes
- Fixed spelling errors in some documents([#1300](https://github.com/mantlenetworkio/mantle/pull/1300))
- Added Mantle audit report files([#1333](https://github.com/mantlenetworkio/mantle/pull/1333))
- Deleted error judge logic,which causing incorrect judgment logic and resulting in timeout configuration failure([#1337](https://github.com/mantlenetworkio/mantle/pull/1337))
- Handled testnet MNT token address compatibility([#1338](https://github.com/mantlenetworkio/mantle/pull/1338))
- Fixed gas oracle go mod and dockerfile([#1341](https://github.com/mantlenetworkio/mantle/pull/1341),[#1342](https://github.com/mantlenetworkio/mantle/pull/1342))
- Fixed gas oracle update frequency and block log query range([#1344](https://github.com/mantlenetworkio/mantle/pull/1344),[#1347](https://github.com/mantlenetworkio/mantle/pull/1347))
- Updated gas oracle metric, fixed bigint cmp formula and fee_Scalar false alarm([#1345](https://github.com/mantlenetworkio/mantle/pull/1345),[#1346](https://github.com/mantlenetworkio/mantle/pull/1346))


## [v0.4.3-alpha.0](https://github.com/mantlenetworkio/mantle/commits/v0.4.3-alpha.0) - 2023-08-03

### Features
- DTL
- Optimized performance by separating L1 and L2 process execution time for synchronous data ([#1298](https://github.com/mantlenetworkio/mantle/pull/1298))
- SDK
- Enhanced compatibility by aligning the standard-bridge with the selected chainID ([#1268](https://github.com/mantlenetworkio/mantle/pull/1268))
- GasOracle
- Improved metric accuracy by modifying token_ratio ([#1310](https://github.com/mantlenetworkio/mantle/pull/1310))

### Bug Fixes
- Resolved a 'nonce too high' error caused by the DA verifier([#1313](https://github.com/mantlenetworkio/mantle/pull/1313))
- Fixed a panic issue during traceCall operation, eliminating unexpected program crashes ([#1305](https://github.com/mantlenetworkio/mantle/pull/1305))
- Handled unhandled errors in DA upgrade tool and NewStateTransition of l2geth, enhancing error handling and preventing potential issues ([#1288](https://github.com/mantlenetworkio/mantle/pull/1288), [#1295](https://github.com/mantlenetworkio/mantle/pull/1295))
- Strengthened seed generation process security by introducing passphrase protection ([#1297](https://github.com/mantlenetworkio/mantle/pull/1297))
- Addressed nonce overflow and other security-related concerns, bolstering system security ([#1293](https://github.com/mantlenetworkio/mantle/pull/1293), [#1292](https://github.com/mantlenetworkio/mantle/pull/1292))
- Improved JWT secret key configuration and handling for enhanced security ([#1226](https://github.com/mantlenetworkio/mantle/pull/1226))
- Renamed 'rollup' to 'Accepted on layer1', enhancing clarity and reflecting its role in the network's hierarchy ([#1314](https://github.com/mantlenetworkio/mantle/pull/1314))
- Resolved the issue of the 'Log/txstatus' element not found, addressing a gap in log information ([#1264](https://github.com/mantlenetworkio/mantle/pull/1264))
- Cleaned up unused DA contracts, optimizing the codebase by removing redundant contracts ([#1283](https://github.com/mantlenetworkio/mantle/pull/1283))
- Rectified Mantle token compilation errors on the Foundry platform, ensuring successful compilation ([#1282](https://github.com/mantlenetworkio/mantle/pull/1282))
- Fixed go mod and mt-challenger configuration issues, modified 'WMANTLE9' to 'WMANTLE' for compatibility and clarity ([#1302](https://github.com/mantlenetworkio/mantle/pull/1302), [#1281](https://github.com/mantlenetworkio/mantle/pull/1281))
- Addressed 'sigma MNT-35' issue, conducted a TSS security audit fix, ensuring accurate handling of 'sigma MNT-35' and enhancing TSS security ([#1257](https://github.com/mantlenetworkio/mantle/pull/1257))
- Fixed ConsenSys audit issue: cs-6.18, ensuring compliance with audit requirements ([#1243](https://github.com/mantlenetworkio/mantle/pull/1243))
- Addressed various ConsenSys audit issues (cs-6.30, cs-6.42, cs-6.40, cs-6.37, cs-6.14, cs-6.34, cs-6.22, cs-6.33), ensuring codebase compliance ([#1219](https://github.com/mantlenetworkio/mantle/pull/1219), [#1212](https://github.com/mantlenetworkio/mantle/pull/1212), [#1210](https://github.com/mantlenetworkio/mantle/pull/1210), [#1207](https://github.com/mantlenetworkio/mantle/pull/1207), [#1204](https://github.com/mantlenetworkio/mantle/pull/1204), [#1194](https://github.com/mantlenetworkio/mantle/pull/1194), [#1191](https://github.com/mantlenetworkio/mantle/pull/1191), [#1188](https://github.com/mantlenetworkio/mantle/pull/1188))
- Resolved lock threshold validation issue, enhancing security and preventing potential vulnerabilities ([#1227](https://github.com/mantlenetworkio/mantle/pull/1227))
- Fixed jwt secret key configuration issue, improving the handling of secret keys ([#1226](https://github.com/mantlenetworkio/mantle/pull/1226))
- Resolved ConsenSys minor audit issues (cs-6.35, cs-6.43, cs-6.44, cs-6.45), ensuring adherence to audit recommendations ([#1217](https://github.com/mantlenetworkio/mantle/pull/1217), [#1183](https://github.com/mantlenetworkio/mantle/pull/1183))
- Removed unused struct related to 'mnt-37', added a default message handler for function ProcessOneMessage:cs-6.26 ([#1202](https://github.com/mantlenetworkio/mantle/pull/1202), [#1198](https://github.com/mantlenetworkio/mantle/pull/1198))


## [v0.4.2](https://github.com/mantlenetworkio/mantle/commits/v0.4.2) - 2023-07-10

### Features
Expand Down
85 changes: 41 additions & 44 deletions batch-submitter/batch_submitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/getsentry/sentry-go"
"github.com/urfave/cli"

"github.com/mantlenetworkio/mantle/batch-submitter/drivers/proposer"
"github.com/mantlenetworkio/mantle/batch-submitter/drivers/sequencer"
Expand All @@ -17,6 +15,9 @@ import (
"github.com/mantlenetworkio/mantle/bss-core/dial"
"github.com/mantlenetworkio/mantle/bss-core/metrics"
"github.com/mantlenetworkio/mantle/bss-core/txmgr"

"github.com/getsentry/sentry-go"
"github.com/urfave/cli"
)

// Main is the entrypoint into the batch submitter service. This method returns
Expand All @@ -30,10 +31,6 @@ func Main(gitVersion string) func(ctx *cli.Context) error {
return err
}

log.Info("Config parsed",
"min_tx_size", cfg.MinL1TxSize,
"max_tx_size", cfg.MaxL1TxSize)

// The call to defer is done here so that any errors logged from
// this point on are posted to Sentry before exiting.
if cfg.SentryEnable {
Expand Down Expand Up @@ -130,23 +127,22 @@ func Main(gitVersion string) func(ctx *cli.Context) error {
var services []*bsscore.Service
if cfg.RunTxBatchSubmitter {
batchTxDriver, err := sequencer.NewDriver(sequencer.Config{
Name: "Sequencer",
L1Client: l1Client,
L2Client: l2Client,
BlockOffset: cfg.BlockOffset,
MinTxSize: cfg.MinL1TxSize,
MaxTxSize: cfg.MaxL1TxSize,
MaxPlaintextBatchSize: cfg.MaxPlaintextBatchSize,
DaUpgradeBlock: cfg.DaUpgradeBlock,
DAAddr: common.Address(common.HexToAddress(cfg.DAAddress)),
CTCAddr: ctcAddress,
ChainID: chainID,
PrivKey: sequencerPrivKey,
EnableSequencerHsm: cfg.EnableSequencerHsm,
SequencerHsmAddress: cfg.SequencerHsmAddress,
SequencerHsmAPIName: cfg.SequencerHsmAPIName,
SequencerHsmCreden: cfg.SequencerHsmCreden,
BatchType: sequencer.BatchTypeFromString(cfg.SequencerBatchType),
Name: "Sequencer",
L1Client: l1Client,
L2Client: l2Client,
BlockOffset: cfg.BlockOffset,
DaUpgradeBlock: cfg.DaUpgradeBlock,
DAAddr: common.Address(common.HexToAddress(cfg.DAAddress)),
CTCAddr: ctcAddress,
ChainID: chainID,
PrivKey: sequencerPrivKey,
EnableSequencerHsm: cfg.EnableSequencerHsm,
SequencerHsmAddress: cfg.SequencerHsmAddress,
SequencerHsmAPIName: cfg.SequencerHsmAPIName,
SequencerHsmCreden: cfg.SequencerHsmCreden,
BatchType: sequencer.BatchTypeFromString(cfg.SequencerBatchType),
MaxRollupTxn: cfg.MaxRollupTxn,
MinRollupTxn: cfg.MinRollupTxn,
})
if err != nil {
return err
Expand All @@ -164,27 +160,28 @@ func Main(gitVersion string) func(ctx *cli.Context) error {

if cfg.RunStateBatchSubmitter {
batchStateDriver, err := proposer.NewDriver(proposer.Config{
Name: "Proposer",
L1Client: l1Client,
L2Client: l2Client,
TssClient: tssClient,
BlockOffset: cfg.BlockOffset,
MinStateRootElements: cfg.MinStateRootElements,
MaxStateRootElements: cfg.MaxStateRootElements,
SCCAddr: sccAddress,
CTCAddr: ctcAddress,
FPRollupAddr: common.HexToAddress(cfg.FPRollupAddress),
ChainID: chainID,
PrivKey: proposerPrivKey,
SccRollback: cfg.EnableSccRollback,
MaxBatchSubmissionTime: cfg.MaxBatchSubmissionTime,
PollInterval: cfg.PollInterval,
FinalityConfirmations: cfg.FinalityConfirmations,
EnableProposerHsm: cfg.EnableProposerHsm,
ProposerHsmAddress: cfg.ProposerHsmAddress,
ProposerHsmCreden: cfg.ProposerHsmCreden,
ProposerHsmAPIName: cfg.ProposerHsmAPIName,
AllowL2AutoRollback: cfg.AllowL2AutoRollback,
Name: "Proposer",
L1Client: l1Client,
L2Client: l2Client,
TssClient: tssClient,
BlockOffset: cfg.BlockOffset,
MinStateRootElements: cfg.MinStateRootElements,
MaxStateRootElements: cfg.MaxStateRootElements,
SCCAddr: sccAddress,
CTCAddr: ctcAddress,
FPRollupAddr: common.HexToAddress(cfg.FPRollupAddress),
ChainID: chainID,
PrivKey: proposerPrivKey,
SccRollback: cfg.EnableSccRollback,
RollupTimeout: cfg.RollupTimeout,
PollInterval: cfg.PollInterval,
FinalityConfirmations: cfg.FinalityConfirmations,
EnableProposerHsm: cfg.EnableProposerHsm,
ProposerHsmAddress: cfg.ProposerHsmAddress,
ProposerHsmCreden: cfg.ProposerHsmCreden,
ProposerHsmAPIName: cfg.ProposerHsmAPIName,
AllowL2AutoRollback: cfg.AllowL2AutoRollback,
MinTimeoutStateRootElements: cfg.MinTimeoutStateRootElements,
})
if err != nil {
return err
Expand Down
88 changes: 42 additions & 46 deletions batch-submitter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,6 @@ type Config struct {
// FPRollupAddress is the fraud proof rollup contract address.
FPRollupAddress string

// MinL1TxSize is the minimum size in bytes of any L1 transactions generated
// by the batch submitter.
MinL1TxSize uint64

// MaxL1TxSize is the maximum size in bytes of any L1 transactions generated
// by the batch submitter.
MaxL1TxSize uint64

// MaxPlaintextL1TxSize is the maximum size in bytes of the plaintext tx
// data encoded in batches.
MaxPlaintextBatchSize uint64

// MinStateRootElements is the minimum number of state root elements that
// can be submitted in single proposer batch.
MinStateRootElements uint64
Expand All @@ -105,9 +93,8 @@ type Config struct {
// in a batch.
MaxTxBatchCount uint64

// MaxBatchSubmissionTime is the maximum amount of time that we will
// wait before submitting an under-sized batch.
MaxBatchSubmissionTime time.Duration
// RollupTimeout is the criterion which used to determine if the transaction is timeout.
RollupTimeout time.Duration

// PollInterval is the delay between querying L2 for more transaction
// and creating a new batch.
Expand Down Expand Up @@ -232,6 +219,15 @@ type Config struct {

// batch submitter rollback
AllowL2AutoRollback bool

// MaxRollupTxn is the maximum length of rollup batch transactions for every round.
MaxRollupTxn uint64

// MinRollupTxn is the minimum length of rollup batch transactions for every round.
MinRollupTxn uint64

// MinTimeoutStateRootElements is the minimum length of timeout rollup batch transactions for every round.
MinTimeoutStateRootElements uint64
}

// NewConfig parses the Config from the provided flags or environment variables.
Expand All @@ -250,12 +246,9 @@ func NewConfig(ctx *cli.Context) (Config, error) {
CTCAddress: ctx.GlobalString(flags.CTCAddressFlag.Name),
SCCAddress: ctx.GlobalString(flags.SCCAddressFlag.Name),
FPRollupAddress: ctx.GlobalString(flags.FPRollupAddressFlag.Name),
MinL1TxSize: ctx.GlobalUint64(flags.MinL1TxSizeFlag.Name),
MaxL1TxSize: ctx.GlobalUint64(flags.MaxL1TxSizeFlag.Name),
MaxPlaintextBatchSize: ctx.GlobalUint64(flags.MaxPlaintextBatchSizeFlag.Name),
MinStateRootElements: ctx.GlobalUint64(flags.MinStateRootElementsFlag.Name),
MaxStateRootElements: ctx.GlobalUint64(flags.MaxStateRootElementsFlag.Name),
MaxBatchSubmissionTime: ctx.GlobalDuration(flags.MaxBatchSubmissionTimeFlag.Name),
RollupTimeout: ctx.GlobalDuration(flags.RollupTimeoutFlag.Name),
PollInterval: ctx.GlobalDuration(flags.PollIntervalFlag.Name),
NumConfirmations: ctx.GlobalUint64(flags.NumConfirmationsFlag.Name),
SafeAbortNonceTooLowCount: ctx.GlobalUint64(flags.SafeAbortNonceTooLowCountFlag.Name),
Expand All @@ -266,33 +259,36 @@ func NewConfig(ctx *cli.Context) (Config, error) {
SafeMinimumEtherBalance: ctx.GlobalUint64(flags.SafeMinimumEtherBalanceFlag.Name),
ClearPendingTxs: ctx.GlobalBool(flags.ClearPendingTxsFlag.Name),
/* Optional Flags */
LogLevel: ctx.GlobalString(flags.LogLevelFlag.Name),
LogTerminal: ctx.GlobalBool(flags.LogTerminalFlag.Name),
SentryEnable: ctx.GlobalBool(flags.SentryEnableFlag.Name),
SentryDsn: ctx.GlobalString(flags.SentryDsnFlag.Name),
SentryTraceRate: ctx.GlobalDuration(flags.SentryTraceRateFlag.Name),
BlockOffset: ctx.GlobalUint64(flags.BlockOffsetFlag.Name),
SequencerPrivateKey: ctx.GlobalString(flags.SequencerPrivateKeyFlag.Name),
ProposerPrivateKey: ctx.GlobalString(flags.ProposerPrivateKeyFlag.Name),
Mnemonic: ctx.GlobalString(flags.MnemonicFlag.Name),
SequencerHDPath: ctx.GlobalString(flags.SequencerHDPathFlag.Name),
ProposerHDPath: ctx.GlobalString(flags.ProposerHDPathFlag.Name),
SequencerBatchType: ctx.GlobalString(flags.SequencerBatchType.Name),
MetricsServerEnable: ctx.GlobalBool(flags.MetricsServerEnableFlag.Name),
MetricsHostname: ctx.GlobalString(flags.MetricsHostnameFlag.Name),
MetricsPort: ctx.GlobalUint64(flags.MetricsPortFlag.Name),
DisableHTTP2: ctx.GlobalBool(flags.HTTP2DisableFlag.Name),
EnableSccRollback: ctx.GlobalBool(flags.SccRollbackFlag.Name),
EnableSequencerHsm: ctx.GlobalBool(flags.EnableSequencerHsmFlag.Name),
SequencerHsmAddress: ctx.GlobalString(flags.SequencerHsmAddressFlag.Name),
SequencerHsmAPIName: ctx.GlobalString(flags.SequencerHsmAPIName.Name),
SequencerHsmCreden: ctx.GlobalString(flags.SequencerHsmCreden.Name),
EnableProposerHsm: ctx.GlobalBool(flags.EnableProposerHsmFlag.Name),
ProposerHsmAddress: ctx.GlobalString(flags.ProposerHsmAddressFlag.Name),
ProposerHsmAPIName: ctx.GlobalString(flags.ProposerHsmAPIName.Name),
ProposerHsmCreden: ctx.GlobalString(flags.ProposerHsmCreden.Name),
RollupClientHttp: ctx.GlobalString(flags.RollupClientHttpFlag.Name),
AllowL2AutoRollback: ctx.GlobalBool(flags.AllowL2AutoRollback.Name),
LogLevel: ctx.GlobalString(flags.LogLevelFlag.Name),
LogTerminal: ctx.GlobalBool(flags.LogTerminalFlag.Name),
SentryEnable: ctx.GlobalBool(flags.SentryEnableFlag.Name),
SentryDsn: ctx.GlobalString(flags.SentryDsnFlag.Name),
SentryTraceRate: ctx.GlobalDuration(flags.SentryTraceRateFlag.Name),
BlockOffset: ctx.GlobalUint64(flags.BlockOffsetFlag.Name),
SequencerPrivateKey: ctx.GlobalString(flags.SequencerPrivateKeyFlag.Name),
ProposerPrivateKey: ctx.GlobalString(flags.ProposerPrivateKeyFlag.Name),
Mnemonic: ctx.GlobalString(flags.MnemonicFlag.Name),
SequencerHDPath: ctx.GlobalString(flags.SequencerHDPathFlag.Name),
ProposerHDPath: ctx.GlobalString(flags.ProposerHDPathFlag.Name),
SequencerBatchType: ctx.GlobalString(flags.SequencerBatchType.Name),
MetricsServerEnable: ctx.GlobalBool(flags.MetricsServerEnableFlag.Name),
MetricsHostname: ctx.GlobalString(flags.MetricsHostnameFlag.Name),
MetricsPort: ctx.GlobalUint64(flags.MetricsPortFlag.Name),
DisableHTTP2: ctx.GlobalBool(flags.HTTP2DisableFlag.Name),
EnableSccRollback: ctx.GlobalBool(flags.SccRollbackFlag.Name),
EnableSequencerHsm: ctx.GlobalBool(flags.EnableSequencerHsmFlag.Name),
SequencerHsmAddress: ctx.GlobalString(flags.SequencerHsmAddressFlag.Name),
SequencerHsmAPIName: ctx.GlobalString(flags.SequencerHsmAPIName.Name),
SequencerHsmCreden: ctx.GlobalString(flags.SequencerHsmCreden.Name),
EnableProposerHsm: ctx.GlobalBool(flags.EnableProposerHsmFlag.Name),
ProposerHsmAddress: ctx.GlobalString(flags.ProposerHsmAddressFlag.Name),
ProposerHsmAPIName: ctx.GlobalString(flags.ProposerHsmAPIName.Name),
ProposerHsmCreden: ctx.GlobalString(flags.ProposerHsmCreden.Name),
RollupClientHttp: ctx.GlobalString(flags.RollupClientHttpFlag.Name),
AllowL2AutoRollback: ctx.GlobalBool(flags.AllowL2AutoRollback.Name),
MaxRollupTxn: ctx.GlobalUint64(flags.MaxRollupTxnFlag.Name),
MinRollupTxn: ctx.GlobalUint64(flags.MinRollupTxnFlag.Name),
MinTimeoutStateRootElements: ctx.GlobalUint64(flags.MinTimeoutStateRootElementsFlag.Name),
}

err := ValidateConfig(&cfg)
Expand Down
Loading

0 comments on commit 5cda5f8

Please sign in to comment.