From cccd81a47b77b0fb0775be2009aa38515963c6c9 Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Mon, 10 Jun 2024 18:45:40 +0200 Subject: [PATCH] =?UTF-8?q?add=20ANSI=20art=20placeholder=20for=20Electra?= =?UTF-8?q?=20=F0=9F=A6=92=20(#6338)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Trigger ANSI art on upgrade to Electra Art created by http://beatscribe.com (beatscribe#1008 on Discord) --- .../consensus_object_pools/blockchain_dag.nim | 5 +++- .../vanity_logs/electra/color.ans | 28 +++++++++++++++++++ .../vanity_logs/electra/mono.txt | 28 +++++++++++++++++++ .../vanity_logs/vanity_logs.nim | 7 +++++ beacon_chain/nimbus_beacon_node.nim | 12 +++++--- 5 files changed, 75 insertions(+), 5 deletions(-) create mode 100644 beacon_chain/consensus_object_pools/vanity_logs/electra/color.ans create mode 100644 beacon_chain/consensus_object_pools/vanity_logs/electra/mono.txt diff --git a/beacon_chain/consensus_object_pools/blockchain_dag.nim b/beacon_chain/consensus_object_pools/blockchain_dag.nim index 9445828be..69fcb661a 100644 --- a/beacon_chain/consensus_object_pools/blockchain_dag.nim +++ b/beacon_chain/consensus_object_pools/blockchain_dag.nim @@ -2408,7 +2408,7 @@ proc updateHead*( if dag.headState.kind > lastHeadKind: case dag.headState.kind - of ConsensusFork.Phase0 .. ConsensusFork.Bellatrix, ConsensusFork.Electra: + of ConsensusFork.Phase0 .. ConsensusFork.Bellatrix: discard of ConsensusFork.Capella: if dag.vanityLogs.onUpgradeToCapella != nil: @@ -2416,6 +2416,9 @@ proc updateHead*( of ConsensusFork.Deneb: if dag.vanityLogs.onUpgradeToDeneb != nil: dag.vanityLogs.onUpgradeToDeneb() + of ConsensusFork.Electra: + if dag.vanityLogs.onUpgradeToElectra != nil: + dag.vanityLogs.onUpgradeToElectra() if dag.vanityLogs.onKnownBlsToExecutionChange != nil and checkBlsToExecutionChanges( diff --git a/beacon_chain/consensus_object_pools/vanity_logs/electra/color.ans b/beacon_chain/consensus_object_pools/vanity_logs/electra/color.ans new file mode 100644 index 000000000..aea0a7ad9 --- /dev/null +++ b/beacon_chain/consensus_object_pools/vanity_logs/electra/color.ans @@ -0,0 +1,28 @@ + +..-|\_/| +  text .-'..d :.: $ +(_: __. :::::$ +`-' ? :::: $ +\ :::: $ +\::::::$ +area\ :::::$ +|:.::: $ + `| :::: $..__ +`.::::::.::.`-. +|:::::::::::::`--. +here `.::::.:::::::::::`---..... +  `.:::::::::::::::::::::::`\ + |:::::::::::::::::::::::::| + |:::::::::::::::::::::::|:| +  |::::::::::::|::::::::::|:| +':::)___..----\ :::::| .`. \ +|:::| | :|`.::::|: : `.`. +() () O  O |:::| |. ||:::| `.: |:| +\ / \ /   |:::| | :|`.:::`. .:`.`. +() ()()  ()  () O () |:::| |: |::::| |::|`.`. +\  / \ // / / |:::| | :||:::| | :| ))) + () ()  O() O ()  () O  () |:::||.:.| () ()::| |:..;((( () +. \. /. \. // O. /. . \. /. \ /. . \ .'::.'|::'|. /. . /.|::|. ` :.\ `/ . +....()O...O()...\()()....()O...O.()....()|:::| |_M()()....()..:::|.()|: :()..() +\../...\./...\../....\../...\./....\../..|:::|\../....\../...|:::<...\_M/|..... + ():::::O:::::()::::::():::::O::::::():::|_N_|:()::::::()::::|_N_|::::()::::::: diff --git a/beacon_chain/consensus_object_pools/vanity_logs/electra/mono.txt b/beacon_chain/consensus_object_pools/vanity_logs/electra/mono.txt new file mode 100644 index 000000000..bfe25591e --- /dev/null +++ b/beacon_chain/consensus_object_pools/vanity_logs/electra/mono.txt @@ -0,0 +1,28 @@ + + ..-|\_/| + text .-'..d :.: $ + (_: __. :::::$ + `-' ? :::: $ + \ :::: $ + \::::::$ + area \ :::::$ + |:.::: $ + `| :::: $..__ + `.::::::.::.`-. + |:::::::::::::`--. + here `.::::.:::::::::::`---..... + `.:::::::::::::::::::::::`\ + |:::::::::::::::::::::::::| + |:::::::::::::::::::::::|:| + |::::::::::::|::::::::::|:| + ':::)___..----\ :::::| .`. \ + |:::| | :| `.::::|: : `.`. + () () O O |:::| |. | |:::| `.: |:| + \ / \ / |:::| | :| `.:::`. .:`.`. + () ()() () () O () |:::| |: | ::::| |::|`.`. + \ / \ / / / / |:::| | :| |:::| | :| ))) + () () O() O () () O () |:::||.:.| () ()::| |:..;((( () +. \. /. \. // O. /. . \. /. \ /. . \ .'::.'|::'|. /. . /.|::|. ` :.\ `/ . +....()O...O()...\()()....()O...O.()....()|:::| |_M()()....()..:::|.()|: :()..() +\../...\./...\../....\../...\./....\../..|:::|\../....\../...|:::<...\_M/|..... + ():::::O:::::()::::::():::::O::::::():::|_N_|:()::::::()::::|_N_|::::()::::::: diff --git a/beacon_chain/consensus_object_pools/vanity_logs/vanity_logs.nim b/beacon_chain/consensus_object_pools/vanity_logs/vanity_logs.nim index 111035bed..23f32f0fe 100644 --- a/beacon_chain/consensus_object_pools/vanity_logs/vanity_logs.nim +++ b/beacon_chain/consensus_object_pools/vanity_logs/vanity_logs.nim @@ -34,6 +34,10 @@ type # in case of chain reorgs around the upgrade. onUpgradeToDeneb*: LogProc + # Gets displayed on upgrade to Electra. May be displayed multiple times + # in case of chain reorgs around the upgrade. + onUpgradeToElectra*: LogProc + # Created by http://beatscribe.com/ (beatscribe#1008 on Discord) # These need to be the main body of the log not to be reformatted or escaped. @@ -47,3 +51,6 @@ proc capellaBlink*() = notice "\n" & staticRead("capella" / "blink.ans") proc denebMono*() = notice "\n" & staticRead("deneb" / "mono.txt") proc denebColor*() = notice "\n" & staticRead("deneb" / "color.ans") + +proc electraMono*() = notice "\n" & staticRead("electra" / "mono.txt") +proc electraColor*() = notice "\n" & staticRead("electra" / "color.ans") diff --git a/beacon_chain/nimbus_beacon_node.nim b/beacon_chain/nimbus_beacon_node.nim index 6a7385105..185ff1b71 100644 --- a/beacon_chain/nimbus_beacon_node.nim +++ b/beacon_chain/nimbus_beacon_node.nim @@ -147,14 +147,16 @@ func getVanityLogs(stdoutKind: StdoutLogKind): VanityLogs = onFinalizedMergeTransitionBlock: bellatrixBlink, onUpgradeToCapella: capellaColor, onKnownBlsToExecutionChange: capellaBlink, - onUpgradeToDeneb: denebColor) + onUpgradeToDeneb: denebColor, + onUpgradeToElectra: electraColor) of StdoutLogKind.NoColors: VanityLogs( onMergeTransitionBlock: bellatrixMono, onFinalizedMergeTransitionBlock: bellatrixMono, onUpgradeToCapella: capellaMono, onKnownBlsToExecutionChange: capellaMono, - onUpgradeToDeneb: denebMono) + onUpgradeToDeneb: denebMono, + onUpgradeToElectra: electraMono) of StdoutLogKind.Json, StdoutLogKind.None: VanityLogs( onMergeTransitionBlock: @@ -166,12 +168,14 @@ func getVanityLogs(stdoutKind: StdoutLogKind): VanityLogs = onKnownBlsToExecutionChange: (proc() = notice "🦉 BLS to execution changed 🦉"), onUpgradeToDeneb: - (proc() = notice "🐟 Proto-Danksharding is ON 🐟")) + (proc() = notice "🐟 Proto-Danksharding is ON 🐟"), + onUpgradeToElectra: + (proc() = notice "🦒 [PH] Electra 🦒")) func getVanityMascot(consensusFork: ConsensusFork): string = case consensusFork of ConsensusFork.Electra: - " " + "🦒" of ConsensusFork.Deneb: "🐟" of ConsensusFork.Capella: