Skip to content

Commit

Permalink
Merge branch 'develop' into fix_printf_without_placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
georgehao authored Dec 13, 2023
2 parents c618a1f + bf2692b commit 9e0777f
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 5 deletions.
4 changes: 2 additions & 2 deletions bridge-history-api/abi/backend_abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var (
L2BatchWithdrawERC721Sig common.Hash
L2BatchWithdrawERC1155Sig common.Hash

// scroll mono repo
// scroll monorepo

// ScrollChainABI holds information about ScrollChain's context and available invokable methods.
ScrollChainABI *abi.ABI
Expand Down Expand Up @@ -323,7 +323,7 @@ type L1RelayedMessageEvent struct {
MessageHash common.Hash
}

// L2AppendMessageEvent represents a AppendMessage event raised by the L2MessageQueue contract.
// L2AppendMessageEvent represents an AppendMessage event raised by the L2MessageQueue contract.
type L2AppendMessageEvent struct {
Index *big.Int
MessageHash common.Hash
Expand Down
2 changes: 2 additions & 0 deletions bridge-history-api/utils/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ func InitDB(config *config.DBConfig) (*gorm.DB, error) {
return nil, pingErr
}

sqlDB.SetConnMaxLifetime(time.Minute * 10)
sqlDB.SetConnMaxIdleTime(time.Minute * 5)
sqlDB.SetMaxOpenConns(config.MaxOpenNum)
sqlDB.SetMaxIdleConns(config.MaxIdleNum)

Expand Down
2 changes: 1 addition & 1 deletion common/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var verbose bool

func init() {
v := os.Getenv("LOG_DOCKER")
if v == "true" || v == "TRUE" {
if strings.ToLower(v) == "true" {
verbose = true
}
}
Expand Down
3 changes: 3 additions & 0 deletions common/database/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ func InitDB(config *Config) (*gorm.DB, error) {
return nil, pingErr
}

sqlDB.SetConnMaxLifetime(time.Minute * 10)
sqlDB.SetConnMaxIdleTime(time.Minute * 5)

sqlDB.SetMaxOpenConns(config.MaxOpenNum)
sqlDB.SetMaxIdleConns(config.MaxIdleNum)

Expand Down
2 changes: 1 addition & 1 deletion common/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"runtime/debug"
)

var tag = "v4.3.42"
var tag = "v4.3.43"

var commit = func() string {
if info, ok := debug.ReadBuildInfo(); ok {
Expand Down
3 changes: 3 additions & 0 deletions contracts/src/L1/L1ScrollMessenger.sol
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ contract L1ScrollMessenger is ScrollMessengerBase, IL1ScrollMessenger {
address _rollup,
address _messageQueue
) public initializer {
if (_counterpart == address(0) || _rollup == address(0) || _messageQueue == address(0)) {
revert ErrZeroAddress();
}
ScrollMessengerBase.__ScrollMessengerBase_init(_counterpart, _feeVault);

rollup = _rollup;
Expand Down
3 changes: 3 additions & 0 deletions contracts/src/L2/L2ScrollMessenger.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,15 @@ contract L2ScrollMessenger is ScrollMessengerBase, IL2ScrollMessenger {
***************/

constructor(address _messageQueue) {
if (_messageQueue == address(0)) revert ErrZeroAddress();

_disableInitializers();

messageQueue = _messageQueue;
}

function initialize(address _counterpart) external initializer {
if (_counterpart == address(0)) revert ErrZeroAddress();
ScrollMessengerBase.__ScrollMessengerBase_init(_counterpart, address(0));
}

Expand Down
5 changes: 5 additions & 0 deletions contracts/src/libraries/IScrollMessenger.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
pragma solidity ^0.8.16;

interface IScrollMessenger {
/***********
* Errors *
***********/
error ErrZeroAddress();

/**********
* Events *
**********/
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/test/L1GatewayTestBase.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ abstract contract L1GatewayTestBase is DSTestPlus {
verifier = new MockRollupVerifier();

// Deploy L2 contracts
l2Messenger = new L2ScrollMessenger(address(0));
l2Messenger = new L2ScrollMessenger(address(1));

// Initialize L1 contracts
l1Messenger.initialize(address(l2Messenger), feeVault, address(rollup), address(messageQueue));
Expand Down

0 comments on commit 9e0777f

Please sign in to comment.