-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send bitmap + epoch in outgoing operations #15
base: feat/sovereign-cross-validators-changes
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ package txSender | |
|
||
import ( | ||
"bytes" | ||
"encoding/binary" | ||
"encoding/hex" | ||
|
||
"github.com/multiversx/mx-chain-core-go/core" | ||
|
@@ -68,8 +69,19 @@ func (df *dataFormatter) createRegisterBridgeOperationsData(bridgeData *sovereig | |
registerBridgeOpData := []byte(registerBridgeOpsPrefix + | ||
"@" + hex.EncodeToString(bridgeData.AggregatedSignature) + | ||
"@" + hex.EncodeToString(bridgeData.Hash)) | ||
registerBridgeOpData = append(registerBridgeOpData, hashesHexEncodedArgs...) | ||
|
||
return append(registerBridgeOpData, hashesHexEncodedArgs...) | ||
bridgeDataArgs := []byte( | ||
"@" + hex.EncodeToString(bridgeData.PubKeysBitmap) + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would put There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's mandatory to have bitmap + epoch before |
||
"@" + hex.EncodeToString(uint32ToBytes(bridgeData.Epoch))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we really need the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see now why we need to keep the history. Maybe there are unconfirmed operations sent in the epoch 1, but were signed by the validators in epoch 0 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it is better to keep for at least 2-3 epochs. |
||
|
||
return append(registerBridgeOpData, bridgeDataArgs...) | ||
} | ||
|
||
func uint32ToBytes(value uint32) []byte { | ||
buff := make([]byte, 4) | ||
binary.BigEndian.PutUint32(buff, value) | ||
return buff | ||
} | ||
|
||
func createBridgeOperationsData(hashOfHashes []byte, outGoingOperations []*sovereign.OutGoingOperation) [][]byte { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong imports