Skip to content

fix: load generator improvements #1722

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

Merged
merged 13 commits into from
Jul 10, 2025
Merged

Conversation

samlaf
Copy link
Contributor

@samlaf samlaf commented Jul 3, 2025

Why are these changes needed?

Many small improvements + bug fixes for the load generator.
Please see the commit details for more description on each error/fix.

Checks

  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • I've checked the new test coverage and the coverage percentage didn't drop.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

samlaf added 6 commits July 3, 2025 15:51
Wasn't sanitizing its passed inputs before, which caused a very hard to debug error when deploying to preprod where the RegistryCoordinatorAddr was not populated on the load generator.
Only rebuild when necessary, and make build the default command, as opposed to clean
load generator was crashing when metrics were set to false. Believe this is a mistake in prometheus' promauto API. created an issue for this upstream (see comment in code), and added a hacky fix in our repo in the meantime.
Instead of using one that was read from the config, which was bug prone (and did lead to a bug)
This is needed to debug this call. We had one failing on preprod which was failing with a "execution reverted". We should probably add eth-calls like this before every eth-call site. Unsure if we want info or debug yet...
No longer needed as we read it from the ServiceManager. This is less bug prone.
@samlaf samlaf requested a review from a team as a code owner July 3, 2025 08:00
@samlaf samlaf requested review from cody-littley, dmanc and litt3 July 3, 2025 08:01
@@ -1,5 +1,5 @@
{
"SRSPath": "../../../resources/srs",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relative paths are evil. Not sure how this was working though... I'm running this from the Makefile in test/v2, so should be ../.. to reach root dir. We should prob use relative paths wrt root though?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The relative path was correct for running the tests from the IDE (confirmed by trying to run the tests, and they fail).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this is ugly. I'd have documented this better, but json doesn't allow comments (😠).

I'd prefer to leave the paths so that running the test from an IDE continues to work. It's often quite helpful to run a failing test with a debugger, and it's way more convenient to do that directly from the IDE. The way to get this to also work from the makefile is to run it from the same directory the IDE runs it from.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok think I found the issue and a solution. Turns out golang tests automatically change cwd to be the directory of the test that is currently working. Which is why you guys' ../../../ relative paths were working. However this didn't work with the load-generator because that relative path was interpreted from where the load generator was started.

I changed the paths to be interpreted wrt the config file location, and not the test location. This I argue makes reading the config easier, and also makes using this config file from anywhere work: 59cda27

dmanc
dmanc previously approved these changes Jul 3, 2025
nonSignerOperatorIDsHex[i] = "0x" + hex.EncodeToString(id[:])
}
// We log the call parameters for debugging purposes. If execution reverts, we can debug using tenderly.
cb.logger.Info("eth-call",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would debugging work? Do I have to manually convert to calldata or something like that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idea right now it to use tenderly, which loads the ABI from etherscan and allows to input each field individually.
I would like to also log the calldata directly such that we could also use tenderly or whatever other tool even without the ABI, but that currently doesn't work with the abigen generated code which hides the conversion logic to calldata.

I do plan eventually to switch to abigen v2 which would make this possible though.

litt3
litt3 previously approved these changes Jul 7, 2025
@@ -1,5 +1,5 @@
{
"SRSPath": "../../../resources/srs",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The relative path was correct for running the tests from the IDE (confirmed by trying to run the tests, and they fail).

test/v2/Makefile Outdated
rm -rf bin 2>/dev/null || true

test:
cd correctness && go test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a heads up, I'm rebranding this test suite from correctness tests to live tests. Once my branch merges, this will need to change to cd live. I'll keep an eye on this. If your branch merges before mine, I'll fix it before my branch merges.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 11ec5a4

Before relative paths wrt test files were used in the config file (for SRSPaths), which only worked for the tests, but not for running the load-generator.

I made the paths relative to the config file itself, so now they work for both tests and load-generators. I think it also makes understanding the config files easier (otherwise there's some mysterious relative path which doesn't make sense without knowing that the paths are meant to be interpreted wrt where the tests are located).
litt3
litt3 previously approved these changes Jul 8, 2025
litt3
litt3 previously approved these changes Jul 10, 2025
cody-littley
cody-littley previously approved these changes Jul 10, 2025
@samlaf samlaf dismissed stale reviews from cody-littley and litt3 via 2bb4fd7 July 10, 2025 18:04
@samlaf samlaf merged commit 0ab507f into master Jul 10, 2025
14 checks passed
@samlaf samlaf deleted the fix--load-generator-improvements branch July 10, 2025 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants