-
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?
Send bitmap + epoch in outgoing operations #15
Conversation
@@ -5,7 +5,9 @@ import ( | |||
"testing" | |||
|
|||
"github.com/multiversx/mx-chain-core-go/data/sovereign" | |||
|
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
|
||
return append(registerBridgeOpData, hashesHexEncodedArgs...) | ||
bridgeDataArgs := []byte( | ||
"@" + hex.EncodeToString(bridgeData.PubKeysBitmap) + |
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.
I would put PubKeysBitmap
before or after AggregatedSignature, not at the end
return append(registerBridgeOpData, hashesHexEncodedArgs...) | ||
bridgeDataArgs := []byte( | ||
"@" + hex.EncodeToString(bridgeData.PubKeysBitmap) + | ||
"@" + hex.EncodeToString(uint32ToBytes(bridgeData.Epoch))) |
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.
Do we really need the Epoch
?
Do we really need a to keep all the maps <epoch, validators> in the contract storage?
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.
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 comment
The 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, hashesHexEncodedArgs...) | ||
bridgeDataArgs := []byte( | ||
"@" + hex.EncodeToString(bridgeData.PubKeysBitmap) + | ||
"@" + hex.EncodeToString(uint32ToBytes(bridgeData.Epoch))) |
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.
it is better to keep for at least 2-3 epochs.
|
||
return append(registerBridgeOpData, hashesHexEncodedArgs...) | ||
bridgeDataArgs := []byte( | ||
"@" + hex.EncodeToString(bridgeData.PubKeysBitmap) + |
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.
It's mandatory to have bitmap + epoch before hashesHexEncodedArgs
so the contract can decode the arguments properly.
Append validators pub keys bitmap + epoch at the end of the register operation for cross chain txs from sov->main.
Epoch uint32 will be big endian converted to []byte