Skip to content

Commit

Permalink
feat: proof and timestamp based on unixmilli
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-bisonai committed Aug 5, 2024
1 parent 77d6df9 commit 3f9b36a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion node/pkg/chain/helper/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (s *Signer) MakeGlobalAggregateProof(val int64, timestamp time.Time, name s
s.mu.RLock()
pk := s.PK
s.mu.RUnlock()
return utils.MakeValueSignature(val, timestamp.Unix(), name, pk)
return utils.MakeValueSignature(val, timestamp.UnixMilli(), name, pk)
}

func (s *Signer) autoRenew(ctx context.Context) {
Expand Down
2 changes: 1 addition & 1 deletion node/pkg/dal/collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func (c *Collector) IncomingDataToOutgoingData(ctx context.Context, data *aggreg
return &dalcommon.OutgoingSubmissionData{
Symbol: c.Symbols[data.GlobalAggregate.ConfigID],
Value: strconv.FormatInt(data.GlobalAggregate.Value, 10),
AggregateTime: strconv.FormatInt(data.GlobalAggregate.Timestamp.Unix(), 10),
AggregateTime: strconv.FormatInt(data.GlobalAggregate.Timestamp.UnixMilli(), 10),
Proof: formatBytesToHex(orderedProof),
FeedHash: formatBytesToHex(c.FeedHashes[data.GlobalAggregate.ConfigID]),
Decimals: DefaultDecimals,
Expand Down
2 changes: 1 addition & 1 deletion node/pkg/dal/collector/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func subscribeAddOracleEvent(ctx context.Context, chainReader *websocketchainrea

func orderProof(ctx context.Context, proof []byte, value int64, timestamp time.Time, symbol string, cachedWhitelist []klaytncommon.Address) ([]byte, error) {
proof = removeDuplicateProof(proof)
hash := chainutils.Value2HashForSign(value, timestamp.Unix(), symbol)
hash := chainutils.Value2HashForSign(value, timestamp.UnixMilli(), symbol)
proofChunks, err := splitProofToChunk(proof)
if err != nil {
log.Error().Err(err).Msg("failed to split proof to chunks in orderProof")
Expand Down

0 comments on commit 3f9b36a

Please sign in to comment.