mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 03:16:45 +01:00
Sync ForgerCommitment and use it in coord
Previously the coordinator was erroneously using Slot.BatchesLen to determine when anyone can forge. The correct behaviour is implmenented with the boolean flag `ForgerCommitment`, that is set to true only when there's a batch before the deadline within a slot. Delete Slot.BatchesLen, and the synchronization code of this value from the Synchronizer, as this is not needed
This commit is contained in:
@@ -399,6 +399,8 @@ type Client struct {
|
||||
|
||||
forgeBatchArgsPending map[ethCommon.Hash]*batch
|
||||
forgeBatchArgs map[ethCommon.Hash]*batch
|
||||
|
||||
startBlock int64
|
||||
}
|
||||
|
||||
// NewClient returns a new test Client that implements the eth.IClient
|
||||
@@ -480,7 +482,10 @@ func NewClient(l bool, timer Timer, addr *ethCommon.Address, setup *ClientSetup)
|
||||
maxBlockNum: blockNum,
|
||||
}
|
||||
|
||||
for i := int64(1); i < setup.AuctionConstants.GenesisBlockNum+1; i++ {
|
||||
if c.startBlock == 0 {
|
||||
c.startBlock = 2
|
||||
}
|
||||
for i := int64(1); i < c.startBlock; i++ {
|
||||
c.CtlMineBlock()
|
||||
}
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ func (s *Mock) runProver(ctx context.Context) {
|
||||
"pi_a": ["%v", "%v", "1"],
|
||||
"pi_b": [["%v", "%v"],["%v", "%v"],["1", "0"]],
|
||||
"pi_c": ["%v", "%v", "1"],
|
||||
"protocol": "groth16"
|
||||
"protocol": "groth"
|
||||
}`, i, i+1, i+2, i+3, i+4, i+5, i+6, i+7) //nolint:gomnd
|
||||
s.pubData = fmt.Sprintf(`[
|
||||
"%v"
|
||||
|
||||
Reference in New Issue
Block a user