feat: Add network option for LUKSO Mainnet (#7223)

* Add option for LUKSO network

Signed-off-by: Wolmin <lamonos123@gmail.com>

* Add tests for LUKSO

Signed-off-by: Wolmin <lamonos123@gmail.com>

* Apply spotless

Signed-off-by: Wolmin <lamonos123@gmail.com>

* Add changelog entry

Signed-off-by: Wolmin <lamonos123@gmail.com>

* Fix duplicate func

Signed-off-by: Wolmin <lamonos123@gmail.com>

* Fix changelog

Signed-off-by: Wolmin <lamonos123@gmail.com>

* Add bootnodes to genesis

Signed-off-by: Wolmin <lamonos123@gmail.com>

---------

Signed-off-by: Wolmin <lamonos123@gmail.com>
Signed-off-by: Wolmin <44748271+Wolmin@users.noreply.github.com>
pull/7253/head
Wolmin 5 months ago committed by GitHub
parent 763d99d15f
commit a7fd80b531
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 2
      besu/src/main/java/org/hyperledger/besu/cli/config/NetworkName.java
  3. 17
      besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java
  4. 2
      besu/src/test/java/org/hyperledger/besu/cli/NetworkDeprecationMessageTest.java
  5. 852
      config/src/main/resources/lukso.json

@ -12,6 +12,7 @@
- A full and up to date implementation of EOF for Prague [#7169](https://github.com/hyperledger/besu/pull/7169)
- Add Subnet-Based Peer Permissions. [#7168](https://github.com/hyperledger/besu/pull/7168)
- Reduce lock contention on transaction pool when building a block [#7180](https://github.com/hyperledger/besu/pull/7180)
- Add LUKSO as predefined network name [#7223](https://github.com/hyperledger/besu/pull/7223)
### Bug fixes
- Validation errors ignored in accounts-allowlist and empty list [#7138](https://github.com/hyperledger/besu/issues/7138)

@ -28,6 +28,8 @@ public enum NetworkName {
SEPOLIA("/sepolia.json", BigInteger.valueOf(11155111)),
/** Holešky network name. */
HOLESKY("/holesky.json", BigInteger.valueOf(17000)),
/** LUKSO mainnet network name. */
LUKSO("/lukso.json", BigInteger.valueOf(42)),
/** Dev network name. */
DEV("/dev.json", BigInteger.valueOf(2018), false),

@ -22,6 +22,7 @@ import static org.hyperledger.besu.cli.config.NetworkName.DEV;
import static org.hyperledger.besu.cli.config.NetworkName.EXPERIMENTAL_EIPS;
import static org.hyperledger.besu.cli.config.NetworkName.FUTURE_EIPS;
import static org.hyperledger.besu.cli.config.NetworkName.HOLESKY;
import static org.hyperledger.besu.cli.config.NetworkName.LUKSO;
import static org.hyperledger.besu.cli.config.NetworkName.MAINNET;
import static org.hyperledger.besu.cli.config.NetworkName.MORDOR;
import static org.hyperledger.besu.cli.config.NetworkName.SEPOLIA;
@ -1747,6 +1748,22 @@ public class BesuCommandTest extends CommandTestAbstract {
verify(mockLogger, never()).warn(contains("Holesky is deprecated and will be shutdown"));
}
@Test
public void luksoValuesAreUsed() {
parseCommand("--network", "lukso");
final ArgumentCaptor<EthNetworkConfig> networkArg =
ArgumentCaptor.forClass(EthNetworkConfig.class);
verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any());
verify(mockControllerBuilder).build();
assertThat(networkArg.getValue()).isEqualTo(EthNetworkConfig.getNetworkConfig(LUKSO));
assertThat(commandOutput.toString(UTF_8)).isEmpty();
assertThat(commandErrorOutput.toString(UTF_8)).isEmpty();
}
@Test
public void classicValuesAreUsed() {
parseCommand("--network", "classic");

@ -39,7 +39,7 @@ class NetworkDeprecationMessageTest {
@EnumSource(
value = NetworkName.class,
names = {
"MAINNET", "SEPOLIA", "DEV", "CLASSIC", "MORDOR", "HOLESKY",
"MAINNET", "SEPOLIA", "DEV", "CLASSIC", "MORDOR", "HOLESKY", "LUKSO",
})
void shouldThrowErrorForNonDeprecatedNetworks(final NetworkName network) {
assertThatThrownBy(() -> NetworkDeprecationMessage.generate(network))

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save