@@ -5,14 +5,35 @@ package executor
5
5
6
6
import (
7
7
"context"
8
+ "fmt"
8
9
"time"
9
10
10
11
"github.com/ava-labs/avalanchego/snow/consensus/snowman"
12
+ "github.com/ava-labs/avalanchego/utils"
11
13
"github.com/ava-labs/avalanchego/vms/platformvm/block"
12
14
13
15
smblock "github.com/ava-labs/avalanchego/snow/engine/snowman/block"
14
16
)
15
17
18
+ const ActivationLog = `
19
+ _____ .__ .__ .____ ____
20
+ / _ \___ _______ | | _____ ____ ____ | |__ ____ | | /_ | ______
21
+ / /_\ \ \/ /\__ \ | | \__ \ / \_/ ___\| | \_/ __ \ | | | |/ ___/
22
+ / | \ / / __ \| |__/ __ \| | \ \___| Y \ ___/ | |___| |\___ \
23
+ \____|__ /\_/ (____ /____(____ /___| /\___ >___| /\___ > |_______ \___/____ >
24
+ \/ \/ \/ \/ \/ \/ \/ \/ \/
25
+ ___ _____ __ .__ __ .___ ___
26
+ / _ \_/\ / _ \ _____/ |_|__|__ _______ _/ |_ ____ __| _/ / _ \_/\
27
+ \/ \___/ / /_\ \_/ ___\ __\ \ \/ /\__ \\ __\/ __ \ / __ | \/ \___/ ,_ o
28
+ / | \ \___| | | |\ / / __ \| | \ ___// /_/ | / //\,
29
+ \____|__ /\___ >__| |__| \_/ (____ /__| \___ >____ | \>> |
30
+ \/ \/ \/ \/ \/ \\
31
+
32
+ `
33
+
34
+ // TODO: Remove after Etna is activated
35
+ var EtnaActivationWasLogged = utils .NewAtomic (false )
36
+
16
37
var (
17
38
_ snowman.Block = (* Block )(nil )
18
39
_ snowman.OracleBlock = (* Block )(nil )
@@ -75,7 +96,20 @@ func (b *Block) Verify(ctx context.Context) error {
75
96
}
76
97
77
98
func (b * Block ) Accept (context.Context ) error {
78
- return b .Visit (b .manager .acceptor )
99
+ if err := b .Visit (b .manager .acceptor ); err != nil {
100
+ return err
101
+ }
102
+
103
+ currentTime := b .manager .state .GetTimestamp ()
104
+ if ! b .manager .txExecutorBackend .Config .UpgradeConfig .IsEtnaActivated (currentTime ) {
105
+ return nil
106
+ }
107
+
108
+ if ! EtnaActivationWasLogged .Get () && b .manager .txExecutorBackend .Bootstrapped .Get () {
109
+ fmt .Print (ActivationLog )
110
+ }
111
+ EtnaActivationWasLogged .Set (true )
112
+ return nil
79
113
}
80
114
81
115
func (b * Block ) Reject (context.Context ) error {
0 commit comments