mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 11:26:44 +01:00
- Common - Move ErrTODO and ErrDone to common for usage where needed. - Coordinator - Move prover types to prover package - Handle reorgs, stopping the pipeline when necessary - Handle ethereum transaction errors by stopping the pipeline - In case of ethereum transaction revert, check for known revert causes (more revert causes can be added to handle more cases) - Fix skipped transactions in TxManager confirmation logic - Cancel and wait for provers to be ready - Connect L2DB to: - purge l2txs due to timeout - mark l2txs at the different states - Connect HistoryDB to query L1UserTxs to forge in an L1Batch - L2DB - Skip update functions when the input slices have no values (to avoid a query with no values that results in an SQL error) - StateDB - In LocalStateDB, fix Reset when mt == nil - Prover (new package) - Rename the interface to Prover - Rename the mock struct to Mock - Extend Prover interface methods to provide everything required by the coordinator - Begin implementing required http client code to interact with server proof (not tested) - Synchronizer: - Add LastForgeL1TxsNum to Stats - Test/Client - Update Auction logic to track slots in which there's no forge during the time before the deadline (following the solidity implementation)
34 lines
1.2 KiB
Go
34 lines
1.2 KiB
Go
package common
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"github.com/hermeznetwork/tracerr"
|
|
)
|
|
|
|
// ErrNotInFF is used when the *big.Int does not fit inside the Finite Field
|
|
var ErrNotInFF = errors.New("BigInt not inside the Finite Field")
|
|
|
|
// ErrNumOverflow is used when a given value overflows the maximum capacity of the parameter
|
|
var ErrNumOverflow = errors.New("Value overflows the type")
|
|
|
|
// ErrNonceOverflow is used when a given nonce overflows the maximum capacity of the Nonce (2**40-1)
|
|
var ErrNonceOverflow = errors.New("Nonce overflow, max value: 2**40 -1")
|
|
|
|
// ErrIdxOverflow is used when a given nonce overflows the maximum capacity of the Idx (2**48-1)
|
|
var ErrIdxOverflow = errors.New("Idx overflow, max value: 2**48 -1")
|
|
|
|
// ErrBatchQueueEmpty is used when the coordinator.BatchQueue.Pop() is called and has no elements
|
|
var ErrBatchQueueEmpty = errors.New("BatchQueue empty")
|
|
|
|
// ErrTODO is used when a function is not yet implemented
|
|
var ErrTODO = errors.New("TODO")
|
|
|
|
// ErrDone is used when a function returns earlier due to a cancelled context
|
|
var ErrDone = errors.New("done")
|
|
|
|
// IsErrDone returns true if the error or wrapped (with tracerr) error is ErrDone
|
|
func IsErrDone(err error) bool {
|
|
return tracerr.Unwrap(err) == ErrDone
|
|
}
|