-
Notifications
You must be signed in to change notification settings - Fork 215
stabilization-equivalent-proofs #6686
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
stabilization-equivalent-proofs #6686
Conversation
…ock-sync Check proof on activation block sync
…tiversx/mx-chain-go into equivalent-proofs-feat-stabilization
| currentConsensusType consensusStateMachineType | ||
| } | ||
|
|
||
| func (s *SubroundsHandler) EpochConfirmed(epoch uint32, _ uint64) { |
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.
missing comment
| t.Skip("this is not a short test") | ||
| } | ||
|
|
||
| _ = logger.SetLogLevel("*:DEBUG") |
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.
not to forget removing this
| t.Skip("this is not a short test") | ||
| } | ||
|
|
||
| _ = logger.SetLogLevel("*:DEBUG,process:TRACE,consensus:TRACE") |
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.
not to forget removing this
|
|
||
| err := interceptedData.CheckValidity() | ||
| if err != nil { | ||
| log.Debug("Intercepted data is invalid", "hash", interceptedData.Hash(), "err", err) |
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 think we'll need a special handle here, as interceptedData.Hash() will be the header hash, thus receiving an invalid proof for the first time will lead to always returning ErrInvalidInterceptedData for further proofs(even valid ones)
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.
good find, will fix
process/interface.go
Outdated
| GetNotarizedHeaderHash(nonce uint64) []byte | ||
| ResetProbableHighestNonce() | ||
| SetFinalToLastCheckpoint() | ||
| // ReceivedProof() |
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.
not to forget removing this
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.
fixed
| return boot.headerhash | ||
| } | ||
|
|
||
| func (boot *baseBootstrap) processReceivedProof(headerProof data.HeaderProofHandler) { |
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.
not to forget the implementation
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.
done
scripts/testnet/variables.sh
Outdated
| # Shard structure | ||
| export SHARDCOUNT=2 | ||
| export SHARD_VALIDATORCOUNT=3 | ||
| export SHARDCOUNT=1 |
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.
this should be reverted
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.
reverted
added checks on proofs parameters like epoch, nonce and shard
| func (s *SubroundsHandler) EpochConfirmed(epoch uint32, _ uint64) { | ||
| err := s.initSubroundsForEpoch(epoch) | ||
| if err != nil { | ||
| log.Error("SubroundsHandler.EpochStartAction: cannot initialize subrounds", "error", err) |
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.
| log.Error("SubroundsHandler.EpochStartAction: cannot initialize subrounds", "error", err) | |
| log.Error("SubroundsHandler.EpochConfirmed: cannot initialize subrounds", "error", err) |
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.
done
| if tpn.EnableEpochsHandler.IsFlagEnabledInEpoch(common.EquivalentMessagesFlag, blockHeader.GetEpoch()) { | ||
|
|
||
| // first block after genesis does not have the previous proof, as well as first block after epoch change where the flag gets activated | ||
| shouldAddProof := blockHeader.GetNonce() > 1 && !common.IsEpochChangeBlockForFlagActivation(blockHeader, tpn.EnableEpochsHandler, common.EquivalentMessagesFlag) |
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.
use here common.ShouldBlockHavePrevProof?
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.
done
…tion' into equivalent-proofs-feat-stabilization
epochStart/shardchain/trigger.go
Outdated
| if !t.newEpochHdrReceived && !metaHdr.IsStartOfEpochBlock() { | ||
| return | ||
| } |
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.
not needed, already part of shouldUpdateTrigger
|
|
||
| if bp.hasMissingProof(headerInfo, hdrHash) { | ||
| return nil, fmt.Errorf("%w for header with hash %s", process.ErrMissingHeaderProof, hdrHash) | ||
| return nil, fmt.Errorf("%w for header with hash %s", process.ErrMissingHeaderProof, hex.EncodeToString([]byte(hdrHash))) |
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.
same fix is needed on L663 too
…es, fixes after review
process/block/baseProcess.go
Outdated
| return nil | ||
| } | ||
|
|
||
| func isProofEmpty(proof data.HeaderProofHandler) bool { |
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.
we can add this check when adding a new proof, we should not add an empty proof to pool
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 think the check is already being done on the interceptor in the integrity check
func (iep *interceptedEquivalentProof) integrity() error
removed the check here
epochStart/shardchain/trigger.go
Outdated
| extraDelayForRequestBlockInfo: args.ExtraDelayForRequestBlockInfo, | ||
| } | ||
|
|
||
| // TODO: for equivalent messages this trigger needs to be changed, on start of epoch block proof instead |
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.
is this comment still needed?
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.
no, removed
|
|
||
| headerLeader, err := sr.getLeaderForHeader(headerHandler) | ||
| if err != nil { | ||
| log.Debug("subroundBlock.receivedBlockHeader - error", err.Error()) |
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.
error getting leader for header?
Reasoning behind the pull request
Proposed changes
Testing procedure
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
featbranch created?featbranch merging, do all satellite projects have a proper tag insidego.mod?