osmosisd 6.0.0 crashes  when run according to 'joining testnet' tutorial

I'm experiencing this issue:
https://github.com/osmosis-labs/osmosis/issues/519
But with testnet.
I'm new to running nodes on cosmos, and tried to follow this tutorial:
https://docs.osmosis.zone/developing/network/join-testnet.html
When it comes time to run the node, I get the following fatal error:
Jan 05 20:34:48 TestNode cosmovisor[1395]: panic: unknown field "current_epoch_ended" in types.EpochInfo
Jan 05 20:34:48 TestNode cosmovisor[1395]: goroutine 1 [running]:
Jan 05 20:34:48 TestNode cosmovisor[1395]: github.com/cosmos/cosmos-sdk/codec.(*ProtoCodec).MustUnmarshalJSON(0x198a680, {0xc00017c380, 0xc000d40e70, 0xc000d40ff0}, {0x25b0390, 0xc039bf80d8})

as per issue 519.
As work-arounds I tried using osmosid 6.0.1 after 6.0.0 failed, and tried building cosmovisor from the master branch of cosmos-sdk when v0.42.9 failed.
One thing of note - the following instruction:
wget -O - https://mp20.net/snapshots/osmosis-testnet/osmosis-testnet-mp20-latest.tar.xz | xz -d -v | tar xvf -

Gave the following output Cannot write to ‘-’ (Success)., so I later tried the following incase the issue was with the snapshot:
wget https://mp20.net/snapshots/osmosis-testnet/osmosis-testnet-mp20-latest.tar.xz
tar xf ./osmosis-testnet-mp20-latest.tar.xz
cp -r ./home/ ~/.osmosisd/

Which I believe is equivelant, but I got the same result either way.

I believe there is an issue with the snapshot that was provided. I will be looking into it, sorry for the inconvenience

There was/is indeed an issue with the snapshot. The directory tree contains all of the paths from the root, when the joining testnet guide assumes the archive only contains the folder you need. It looks like dff has created a new package, but it has a similar error where the directory path isn't what the guide expects.
FWIW, until either the guide is updated, or more likely, the archive contains the path the guide expects, you can work around this issue by extracting the data directory in the archive to ~/.osmisisd/data. I'm closing this as it's not related to the repo, and there exists a workaround for now.

@aftermathdigital  how did you solve? I'm running into the same issue. I've attempted to use the updated commands in the docs but had the same issue. I then wget the tar file, extracted, and moved the contents of the home/.../data/ directory to .osmosisd/data   but still doesn't work and gives me the same error.

@chrisbartolo to my understanding, if you added the --strip-components=4 flag then there should be no need to move the contents. So it sounds like there was an issue with the commands you typed in

Hey, I fixed this before the advice to use --strip-components=4 was posted, if you extract the archive you'll notice it contains a subdirectory data, copy this directory to ~/.osmosisd/.
It's possible this is functionally the same as --strip-components=4 is the same, but I know when the snapshot was re-uploaded it had a different path again, so to be sure you can just manually copy out the data folder.

Thanks. Yeah, checked the folders they were being cleared after export due to an issue in my script it seems. Manually cleaned the data folder, extracted the file again and moved all contents. Booted up well, running.


Does this work with Powermock libraries?

Hi,
I am having issues when using TestParameterInjector with powermock libraries. To be specific, when I use PowerMockRunnerDelegate, I get the following error:
@RunWith(PowerMockRunner.class)
@PowerMockRunnerDelegate(TestParameterInjector.class)

java.lang.IllegalStateException: Expected exactly one constructor, but got [protected SomeClass(org.powermock.core.IndicateReloadClass), public SomeClass()]

The class under test should have a default constructor, so you could check that.
If there is no obvious error there, we don't explicitly support Powermock. If you think there is a fix that we could do on our side to support Powermock, I'm happy to consider it.

Constructor present or absent in the class under test doesn't seem to make a difference. The powermock delegation seems to be creating an additional constructor.
I haven't yet looked at a possible solution, but wondering what is the purpose of this check for a single constructor?
https://github.com/google/TestParameterInjector/blob/main/junit4/src/main/java/com/google/testing/junit/testparameterinjector/TestParametersMethodProcessor.java#L447

One potential fix would be check for the public constructor and use that to get the annotations?
  private ImmutableList<Optional<TestParametersValues>>
      getConstructorParametersOrSingleAbsentElement(Class<?> testClass) {
    Constructor<?> constructor = getOnlyConstructor(testClass);
    return hasRelevantAnnotation(constructor)
        ? FluentIterable.from(getConstructorParameters(constructor))
            .transform(Optional::of)
            .toList()
        : ImmutableList.of(Optional.absent());
  }

Here's a fix that I tried locally and works, change is in getOnlyConstructor. Thoughts?
if (constructors.size() > 1 && testClass.isAnnotationPresent(PowerMockRunnerDelegate.class)) {
      for (Constructor<?> constructor : constructors) {
        if (Modifier.isPublic(constructor.getModifiers())) {
          return getOnlyElement(ImmutableList.of(constructor));
        }
      }
    }

Upon further investigation, it looks like the issue happens only when PowerMockRunner and EasyMockSupport is used. For example, I was able to repro the issue with the following class in this repo.
@RunWith(PowerMockRunner.class)
@PowerMockRunnerDelegate(TestParameterInjector.class)
public class PowerMockDelegateTest extends EasyMockSupport {

  public PowerMockDelegateTest() {

  }

  @Test
  public void test(@TestParameter boolean parameter) {
    assertThat(this.getClass().getAnnotation(PowerMockRunnerDelegate.class).annotationType())
            .isEqualTo(PowerMockRunnerDelegate.class);
  }
}

Looks the test runner itself is using getTestClass().getOnlyConstructor(), which is probably modified by Powermock to do the right thing. But then later, the following custom method is called by TestParameterInjector:
  private static Constructor<?> getOnlyConstructor(Class<?> testClass) {
    ImmutableList<Constructor<?>> constructors =
        ImmutableList.copyOf(testClass.getDeclaredConstructors());
    checkState(
        constructors.size() == 1, "Expected exactly one constructor, but got %s", constructors);
    return getOnlyElement(constructors);
  }

Ideally, we'd use getTestClass().getOnlyConstructor() throughout the codebase, but that's a big refactor. Instead, I'm thinking of being more lenient and filtering out non-public constructors first and let getTestClass().getOnlyConstructor() do the validation.

Could you check locally if this works?
import static com.google.common.collect.MoreCollectors.onlyElement;

constructors.stream().filter(c -> Modifier.isPublic(c.getModifiers())).collect(onlyElement())

yes, this works, @nymanjens

Are you planning to push your change? @nymanjens

I didn't have time this week, but I'll try to do it next week.

great, thank you so much!


Make reverse-mappings available.

Based upon #7. End goal: make it available to serializable errors.
Closes #6.

Current coverage is 100% (diff: 100%)

Merging #9 into master will not change coverage

@@           master    #9   diff @@
===================================
  Files           5     5
  Lines         146   167    +21
  Methods         0     0
  Messages        0     0
  Branches        0     0
===================================
+ Hits          146   167    +21
  Misses          0     0
  Partials        0     0

Powered by Codecov. Last update 707a20a...8c87ad7

Closed by #10.


wcag 2.1: update table circle button styles (hybrid)

The Galen tests are a bit broken in hybrid.  But everything looks correct.