-
Notifications
You must be signed in to change notification settings - Fork 198
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
En 7380 early end of epoch #2267
Conversation
iulianpascalau
commented
Sep 3, 2020
•
edited
edited
- added early end of epoch implementation that can be used in the hardfork process
- changed how bech32PubkeyConverter does the stack dump
- added interceptor & resolver debugger in hardfork exporter
…dfork process - changed how bech32PubkeyConverter does the stack dump
…end the hardfork message - added early-end-of-epoch integration test
# Conflicts: # integrationTests/multiShard/smartContract/scCallingSC_test.go
@@ -9,6 +9,7 @@ import ( | |||
"time" | |||
|
|||
"github.com/ElrondNetwork/elrond-go/crypto/peerSignatureHandler" | |||
"github.com/ElrondNetwork/elrond-go/epochStart/notifier" | |||
|
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.
Remove empty line.
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/hardfork.sh
Outdated
fi | ||
|
||
if [ -z "$2" ]; then | ||
echo "epoch argument was not provided. Usage: './hardfork.sh [epoch: number] [forced: true|false]' as in './hardfork.sh 1 false'" |
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.
forced
argument, not 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.
done
api/hardfork/routes_test.go
Outdated
@@ -99,7 +99,7 @@ func TestTrigger_TriggerCanNotExecuteShouldErr(t *testing.T) { | |||
|
|||
expectedErr := errors.New("expected error") | |||
ws := startNodeServer(&mock.HardforkFacade{ | |||
TriggerCalled: func(epoch uint32) error { | |||
TriggerCalled: func(epoch uint32, forced bool) 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.
forced
not used
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
api/hardfork/routes_test.go
Outdated
@@ -144,7 +144,7 @@ func TestTrigger_ManualShouldWork(t *testing.T) { | |||
} | |||
buffHr, _ := json.Marshal(hr) | |||
ws := startNodeServer(&mock.HardforkFacade{ | |||
TriggerCalled: func(epoch uint32) error { | |||
TriggerCalled: func(epoch uint32, forced bool) 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.
forced
not used
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
api/hardfork/routes.go
Outdated
@@ -18,14 +18,15 @@ const ( | |||
|
|||
// FacadeHandler interface defines methods that can be used by the gin webserver | |||
type FacadeHandler interface { | |||
Trigger(epoch uint32) error | |||
Trigger(epoch uint32, forced bool) 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.
withEarlyEndOfEpoch
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
) | ||
|
||
// TriggerHandler defines the functionalities for an start of epoch trigger | ||
type TriggerHandler interface { | ||
Close() error | ||
ForceEpochStart(round uint64) error | ||
ForceEpochStart() |
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.
Don't you need current round?
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.
nope, it is taken automatically as the next possible round. Took into consideration the MinRoundsBetweenEpochs
config value
update/trigger/trigger.go
Outdated
@@ -202,7 +205,16 @@ func (t *trigger) computeAndSetTrigger(epoch uint32, originalPayload []byte) (bo | |||
t.recordedTriggerMessage = originalPayload | |||
} | |||
|
|||
if epoch > t.epochProvider.MetaEpoch() { | |||
if forced { |
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.
With early end of eppch
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
- added more debug prints for hardfork
899377c
# Conflicts: # integrationTests/testProcessorNode.go
- removed some weak warnings
# Conflicts: # integrationTests/testInitializer.go