Skip to content
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

Implement a crosschain consensus breaking change test #3695

Open
lumtis opened this issue Mar 12, 2025 · 1 comment
Open

Implement a crosschain consensus breaking change test #3695

lumtis opened this issue Mar 12, 2025 · 1 comment
Labels
E2E E2E tests related

Comments

@lumtis
Copy link
Member

lumtis commented Mar 12, 2025

Describe the Issue
Some ZetaClient only upgrade, where the consensus breaking test would pass, would still break cctx processing.

Example: change in the outbound creation logic block the signing until enough ZetaClient upgrade the change.

When this happen the ZetaClient upgrade process should be more coordinated compare to if there is no breaking changes between upgrade.

In many case, we could determine manually if the change is crosschain consensus breaking, however a E2E test would simplify the process and allow us to remind when a coordinated release is necessary.

Currently the consensus breaking change pass with these change because a single signer is enought to sign outbound transaction.
For the crosschain consenssu breaking change, a change in the parameter should be performed, or more observer-signer should be added so that we can check if cctx are blocked or not.

@lumtis lumtis added the E2E E2E tests related label Mar 12, 2025
@gartnera
Copy link
Member

gartnera commented Mar 12, 2025

The easiest way to do this right now is to increase to 4 zetaclients on the consensus tests with 3 being on the old version. The threshold is a hardcoded function in go-tss (conversion.GetThreshold())

func TestGetThreshold(t *testing.T) {
	testCases := []struct {
		name          string
		partyNum      int
		wantThreshold int
		wantErr       error
	}{
		{
			name:          "2 parties should have threshold 1",
			partyNum:      2,
			wantThreshold: 1,
			wantErr:       nil,
		},
		{
			name:          "3 parties should have threshold 1",
			partyNum:      3,
			wantThreshold: 1,
			wantErr:       nil,
		},
		{
			name:          "4 parties should have threshold 2",
			partyNum:      4,
			wantThreshold: 2,
			wantErr:       nil,
		},
		{
			name:          "9 parties should have threshold 5",
			partyNum:      9,
			wantThreshold: 5,
			wantErr:       nil,
		},
	}

	for _, tc := range testCases {
		t.Run(tc.name, func(t *testing.T) {
			got, err := GetThreshold(tc.partyNum)
			if err != tc.wantErr {
				t.Fatalf("GetThreshold(%d) got error %v, want %v", tc.partyNum, err, tc.wantErr)
			}
			if got != tc.wantThreshold {
				t.Errorf("GetThreshold(%d) = %d, want %d", tc.partyNum, got, tc.wantThreshold)
			}
		})
	}
}

The slightly better but more complicated way would be to add the ability to override the threshold on keygen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E2E E2E tests related
Projects
None yet
Development

No branches or pull requests

2 participants