mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-06 19:06:42 +01:00
Update node and apply some fixes
- Node - Load Coordinator Fee Account from config - Sign the AccountCreationMsg to generate the AccountCreationAuth - Resolve #465 - Wait for synchronizer termination before stopping coordinator to avoid getting stuck when closing in the following case: - The coordinator stops reading the synchronizer msg channel, and the node gets stuck sending a message to that channel. - Common - Move account creation auth signature code to common. - Update RollupConstInputSHAConstantBytes - Coordinator - Set batch status in the debug file - Propagate SCVariables on reorg - Pipeline: Get SCVariables updates - Resolve #457 - Fix off by 1 error in Pipeline.shouldL1L2Batch() (which shouldn't have caused any problem, but it was not right) - KVDB - Delete future checkpoints after reset - In `ResetFromSynchronizer`, remove all checkpoints first, and follow the same logic as `reset()`. - Cli - Add command to generate a BabyJubJub key pair (to be used for the Coordinator Fee Account) - Node - Adjust example config `Coordinator.L1BatchTimeoutPerc` to avoid missing the L1Batch deadline with the following setup: - a block is mined every 2 seconds - single proof server that takes 2 seconds to calculate a proof - TxProcessor - Close temporary pebble used for the exit tree after usage. - Resolve #463
This commit is contained in:
@@ -57,16 +57,15 @@ func initTest(t *testing.T, chainID uint16, hermezContractAddr ethCommon.Address
|
||||
BJJ: bjj,
|
||||
AccountCreationAuth: nil,
|
||||
}
|
||||
a := &common.AccountCreationAuth{
|
||||
auth := common.AccountCreationAuth{
|
||||
EthAddr: addr,
|
||||
BJJ: bjj,
|
||||
}
|
||||
msg, err := a.HashToSign(chainID, hermezContractAddr)
|
||||
err = auth.Sign(func(hash []byte) ([]byte, error) {
|
||||
return ethCrypto.Sign(hash, ðSk)
|
||||
}, chainID, hermezContractAddr)
|
||||
assert.NoError(t, err)
|
||||
sig, err := ethCrypto.Sign(msg, ðSk)
|
||||
assert.NoError(t, err)
|
||||
sig[64] += 27
|
||||
coordAccount.AccountCreationAuth = sig
|
||||
coordAccount.AccountCreationAuth = auth.Signature
|
||||
|
||||
txsel, err := NewTxSelector(coordAccount, txselDir, sdb, l2DB)
|
||||
require.NoError(t, err)
|
||||
@@ -80,20 +79,18 @@ func initTest(t *testing.T, chainID uint16, hermezContractAddr ethCommon.Address
|
||||
|
||||
func addAccCreationAuth(t *testing.T, tc *til.Context, txsel *TxSelector, chainID uint16, hermezContractAddr ethCommon.Address, username string) []byte {
|
||||
user := tc.Users[username]
|
||||
a := &common.AccountCreationAuth{
|
||||
auth := &common.AccountCreationAuth{
|
||||
EthAddr: user.Addr,
|
||||
BJJ: user.BJJ.Public().Compress(),
|
||||
}
|
||||
msg, err := a.HashToSign(chainID, hermezContractAddr)
|
||||
err := auth.Sign(func(hash []byte) ([]byte, error) {
|
||||
return ethCrypto.Sign(hash, user.EthSk)
|
||||
}, chainID, hermezContractAddr)
|
||||
assert.NoError(t, err)
|
||||
sig, err := ethCrypto.Sign(msg, user.EthSk)
|
||||
assert.NoError(t, err)
|
||||
sig[64] += 27
|
||||
a.Signature = sig
|
||||
|
||||
err = txsel.l2db.AddAccountCreationAuth(a)
|
||||
err = txsel.l2db.AddAccountCreationAuth(auth)
|
||||
assert.NoError(t, err)
|
||||
return a.Signature
|
||||
return auth.Signature
|
||||
}
|
||||
|
||||
func addL2Txs(t *testing.T, txsel *TxSelector, poolL2Txs []common.PoolL2Tx) {
|
||||
|
||||
Reference in New Issue
Block a user