From 6744d7c15fbfce0a3cdc241ce2a16c8d5eee92d5 Mon Sep 17 00:00:00 2001 From: Roshan <48975233+Pythonberg1997@users.noreply.github.com> Date: Mon, 11 Dec 2023 17:12:42 +0800 Subject: [PATCH] chore: modify breath block interval for test (#2054) --- consensus/parlia/abi.go | 45 ++++++++++++++++++++++++++++++++++++-- consensus/parlia/parlia.go | 4 ++-- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/consensus/parlia/abi.go b/consensus/parlia/abi.go index e3e51a890..c10107b5a 100644 --- a/consensus/parlia/abi.go +++ b/consensus/parlia/abi.go @@ -3926,6 +3926,19 @@ const stakeABI = ` "type": "receive", "stateMutability": "payable" }, + { + "type": "function", + "name": "BREATH_BLOCK_INTERVAL", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, { "type": "function", "name": "DEAD_ADDRESS", @@ -4028,6 +4041,24 @@ const stakeABI = ` "outputs": [], "stateMutability": "nonpayable" }, + { + "type": "function", + "name": "claimBatch", + "inputs": [ + { + "name": "operatorAddresses", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "requestNumbers", + "type": "uint256[]", + "internalType": "uint256[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "createValidator", @@ -4347,6 +4378,11 @@ const stakeABI = ` "type": "address", "internalType": "address" }, + { + "name": "createdTime", + "type": "uint256", + "internalType": "uint256" + }, { "name": "voteAddress", "type": "bytes", @@ -4491,7 +4527,7 @@ const stakeABI = ` "internalType": "address" }, { - "name": "dayIndex", + "name": "index", "type": "uint256", "internalType": "uint256" } @@ -4515,7 +4551,7 @@ const stakeABI = ` "internalType": "address" }, { - "name": "dayIndex", + "name": "index", "type": "uint256", "internalType": "uint256" } @@ -5198,6 +5234,11 @@ const stakeABI = ` "name": "InvalidMoniker", "inputs": [] }, + { + "type": "error", + "name": "InvalidRequest", + "inputs": [] + }, { "type": "error", "name": "InvalidValue", diff --git a/consensus/parlia/parlia.go b/consensus/parlia/parlia.go index 67c0a50ae..381874d4f 100644 --- a/consensus/parlia/parlia.go +++ b/consensus/parlia/parlia.go @@ -1178,7 +1178,7 @@ func (p *Parlia) Finalize(chain consensus.ChainHeaderReader, header *types.Heade if p.chainConfig.IsFeynman(header.Number, header.Time) { // TODO: revert this // if time.Unix(int64(parent.Time), 0).Day() < time.Unix(int64(header.Time), 0).Day() { - if time.Unix(int64(header.Time), 0).Minute()%5 > time.Unix(int64(parent.Time), 0).Minute()%5 { + if time.Unix(int64(header.Time), 0).Minute() > time.Unix(int64(parent.Time), 0).Minute() { if err := p.updateValidatorSetV2(state, header, cx, txs, receipts, systemTxs, usedGas, false); err != nil { return err } @@ -1262,7 +1262,7 @@ func (p *Parlia) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header * if p.chainConfig.IsFeynman(header.Number, header.Time) { // TODO: revert this // if time.Unix(int64(parent.Time), 0).Day() < time.Unix(int64(header.Time), 0).Day() { - if time.Unix(int64(header.Time), 0).Minute()%5 > time.Unix(int64(parent.Time), 0).Minute()%5 { + if time.Unix(int64(header.Time), 0).Minute() > time.Unix(int64(parent.Time), 0).Minute() { if err := p.updateValidatorSetV2(state, header, cx, &txs, &receipts, nil, &header.GasUsed, true); err != nil { return nil, nil, err }