Open wawrzek opened 1 month ago
That's very strange. I don't think this is related to advancing the chain by 100 blocks upon startup, that's for separate reasons.
You're hitting this require: https://github.com/Layr-Labs/eigenlayer-middleware/blob/a23de118e7d16081d350c7f83c24261d1421b0ba/src/BLSSignatureChecker.sol#L115
We recently updated the check to be an inequality <
instead of <=
, so now you can't use a RBN that is the current block.
But when submitting a tx the block is advanced (new block is mined when tx is submitted), which seems to indicate that a RBN of currentBlockNumber + 1 would be set..? That seems very strange.
Let me know if this helps... hopefully this will be enough for you to debug the issue.
@samlaf looks like you are right. I applied the following change and error went away:
diff --git a/src/BLSSignatureChecker.sol b/src/BLSSignatureChecker.sol
index c79a225..84a13c7 100644
--- a/src/BLSSignatureChecker.sol
+++ b/src/BLSSignatureChecker.sol
@@ -112,7 +112,7 @@ contract BLSSignatureChecker is IBLSSignatureChecker {
"BLSSignatureChecker.checkSignatures: input nonsigner length mismatch"
);
- require(referenceBlockNumber < uint32(block.number), "BLSSignatureChecker.checkSignatures: invalid reference block");
+ require(referenceBlockNumber <= uint32(block.number), "BLSSignatureChecker.checkSignatures: invalid reference block");
// This method needs to calculate the aggregate pubkey for all signing operators across
// all signing quorums. To do that, we can query the aggregate pubkey for each quorum
Of course, it's not something I cannot keep long term, or suggest to adjust. I just wanted to have a quick test.
We recently updated the check to be an inequality < instead of <=, so now you can't use a RBN that is the current block. But when submitting a tx the block is advanced (new block is mined when tx is submitted)
Is it true for a POS chain? My understanding is that for a POS Ethereum network, a block is validated every 12 seconds (on average). It would mean that for that this AVS is too quick for local network.
I'm not sure if's pure timing.
a) I adjusted the block time creation in Anvil (using the --block-time 10
). AVS works fine.
b) I looked at the POS network, and block ticking much faster than 12 seconds. My knowledge is limited, so I don't know how it's controlled, but maybe that's the problem somewhere in the settings.
diff --git a/tests/anvil/utils.sh b/tests/anvil/utils.sh
index 84184e3..f6f9ded 100644
--- a/tests/anvil/utils.sh
+++ b/tests/anvil/utils.sh
@@ -35,6 +35,7 @@ start_anvil_docker() {
docker run --rm -d --name anvil -p 8545:8545 $LOAD_STATE_VOLUME_DOCKER_ARG $DUMP_STATE_VOLUME_DOCKER_ARG \
--entrypoint anvil \
$FOUNDRY_IMAGE \
- $LOAD_STATE_ANVIL_ARG $DUMP_STATE_ANVIL_ARG --host 0.0.0.0
- sleep 2
+ $LOAD_STATE_ANVIL_ARG $DUMP_STATE_ANVIL_ARG --host 0.0.0.0 \
+ --block-time 10
+ sleep 12
}
After further investigation and playing with 2 parameters in the prysm (included below), I noticed that the problem become intermediate. Sometimes no errors at all, sometimes all the time, and I had runs when the error appeared from time to time.
# Time parameters
SECONDS_PER_SLOT: 2
SLOTS_PER_EPOCH: 2
I use a local devnet (https://github.com/ivy-net/iv1) to run EigenLayer and this AVS locally. Smart contracts are deployed properly, both aggregator and operator starts after only adjusting the Makefile (or passing 2 variables). However, aggregator fails with the following error message (more context from logs below).
I tried to track where the reference block set was, and how it became invalid. I cannot find anything obvious in the code, especially the anvil deployment works fine. On Discord, it was suggested that there is a problem with the AVS code, and it would be fixed.
I see that the anvil deployment is pushed by 100 block forward. Is that related?
Makefile diff