Skip to content

Commit

Permalink
Base 075 f1 (#212)
Browse files Browse the repository at this point in the history
* update pois and filetag

* udpate pois
  • Loading branch information
AstaFrode authored Dec 4, 2023
1 parent 464ee7f commit 2a0d333
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 6 additions & 3 deletions node/pois.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,8 @@ func (n *Node) pois() error {

n.Space("info", "Submit idle space")
txhash, err := n.CertIdleSpace(idleSignInfo, sign)
if err != nil {

if err != nil || txhash == "" {
n.Space("err", fmt.Sprintf("[%s] [CertIdleSpace]: %s", txhash, err))
time.Sleep(pattern.BlockInterval)
time.Sleep(pattern.BlockInterval)
Expand All @@ -430,14 +431,16 @@ func (n *Node) pois() error {
}
if minerInfo.SpaceProofInfo.HasValue() {
_, spaceProofInfo := minerInfo.SpaceProofInfo.Unwrap()
if int64(spaceProofInfo.Rear) < n.Prover.GetRear() {
if int64(spaceProofInfo.Rear) <= n.Prover.GetRear() {
n.Prover.AccRollback(false)
return fmt.Errorf("AccRollbak: [%v] < [%v]", int64(spaceProofInfo.Rear), n.Prover.GetRear())
}
}
}

n.Space("info", fmt.Sprintf("Certified space transactions: %s", txhash))
if txhash != "" {
n.Space("info", fmt.Sprintf("Certified space transactions: %s", txhash))
}

// If the challenge is successful, update the prover status, fileNum is challenged files number,
// the second parameter represents whether it is a delete operation, and the commit proofs should belong to the joining files, so it is false
Expand Down
4 changes: 4 additions & 0 deletions node/serviceChallenge.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,10 @@ func (n *Node) checkServiceProofRecord(
n.SaveTeeWork(serviceProofRecord.AllocatedTeeAccount, teeEndPoint)
}

if utils.ContainsIpv4(teeEndPoint) {
teeEndPoint = strings.TrimPrefix(teeEndPoint, "http://")
}

serviceProofRecord.ServiceBloomFilter, serviceProofRecord.TeeAccountId, serviceProofRecord.Signature, serviceProofRecord.ServiceResult, err = n.batchVerify(randomIndexList, randomList, teeEndPoint, serviceProofRecord)
if err != nil {
return nil
Expand Down

0 comments on commit 2a0d333

Please sign in to comment.