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

Support changing Effective Balance by config. #227

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

rootwarp
Copy link

Support changing Effective Balance which is fixed to 32.
This feature could be useful for testnet and devnet.

.env.example Outdated
@@ -29,6 +29,9 @@ CL_API_URLS=https://<consensus-layer-api-url>
# Validator registry source will be "lido" or "file" (optional).
VALIDATOR_REGISTRY_SOURCE=lido

# Effective Balance is 32 by default.
# EFFECTIVE_BALANCE=32
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for your suggestion!

I would say it is

Suggested change
# EFFECTIVE_BALANCE=32
# EFFECTIVE_BALANCE_INCREMENTS=32

Copy link
Author

Choose a reason for hiding this comment

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

@vgorkavenko thanks for reviewing this PR and I agree with that.
The new commit 93d6c15 pushed for applying your comment :)

@@ -30,6 +30,7 @@ export class AppService implements OnModuleInit, OnApplicationBootstrap {
this.logger.log(`DRY RUN ${this.configService.get('DRY_RUN') ? 'enabled' : 'disabled'}`);
this.logger.log(`Slot time: ${this.configService.get('CHAIN_SLOT_TIME_SECONDS')} seconds`);
this.logger.log(`Epoch size: ${this.configService.get('FETCH_INTERVAL_SLOTS')} slots`);
this.logger.log(`Effective Balance: ${this.configService.get('EFFECTIVE_BALANCE_INCREMENTS')} ETH`);
Copy link
Contributor

Choose a reason for hiding this comment

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

I would say that it is not worth logging. This parameter affects only one particular part of the application while the rest described above are more general

@IsNumber()
@Min(32)
@Transform(({ value }) => parseInt(value, 10), { toClassOnly: true })
public EFFECTIVE_BALANCE_INCREMENTS = 32;
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for misleading you. Let's think about naming this var more concretely. For example, REFERENCE_EFFECTIVE_BALANCE_INCREMENTS

Copy link
Contributor

Choose a reason for hiding this comment

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

Please, don't forget to add this var to README.md

Copy link
Author

Choose a reason for hiding this comment

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

What do you think to use MAX_EFFECTIVE_BALANCE?

@@ -277,6 +277,14 @@ export class EnvironmentVariables {

@IsEnum(WorkingMode)
public WORKING_MODE = WorkingMode.Finalized;

/**
* Effective balance.
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add a few words about the purpose. For example, it's used for ...

@rootwarp
Copy link
Author

Ah, sorry my bad. I leaved lack of information of this PR.
This PR is intended to changing MAX_EFFECTIVE_BALANCE which is fixed as 32ETH.

@vgorkavenko
Copy link
Contributor

Ah, sorry my bad. I leaved lack of information of this PR. This PR is intended to changing MAX_EFFECTIVE_BALANCE which is fixed as 32ETH.

Ah. Okay!
Anyway, I would leave REFERENCE_EFFECTIVE_BALANCE_INCREMENTS because we use this var for calculating perfect attestation reward to calculate missing reward value for monitored validators. So, this reference value might not equal MAX_EFFECTIVE_BALANCE.

For example, the chain has 256 ETH as MAX_EFFECTIVE_BALANCE, but I know that the target effective balance of my monitored validators is 64 ETH, so I would like to set REFERENCE_EFFECTIVE_BALANCE_INCREMENTS=64 to use that as a reference to calculate perfect attestation for me.

Also, we can rethink this model altogether and use not some strict value, but the actual effective balance of the validator to calculate the ideal attestation for it because it can be completely different for each other after that EIP.

I would suggest postponing this PR until we don't have EIP implementation details. What do you think?

@rootwarp
Copy link
Author

Ah, sorry my bad. I leaved lack of information of this PR. This PR is intended to changing MAX_EFFECTIVE_BALANCE which is fixed as 32ETH.

Ah. Okay! Anyway, I would leave REFERENCE_EFFECTIVE_BALANCE_INCREMENTS because we use this var for calculating perfect attestation reward to calculate missing reward value for monitored validators. So, this reference value might not equal MAX_EFFECTIVE_BALANCE.

For example, the chain has 256 ETH as MAX_EFFECTIVE_BALANCE, but I know that the target effective balance of my monitored validators is 64 ETH, so I would like to set REFERENCE_EFFECTIVE_BALANCE_INCREMENTS=64 to use that as a reference to calculate perfect attestation for me.

Also, we can rethink this model altogether and use not some strict value, but the actual effective balance of the validator to calculate the ideal attestation for it because it can be completely different for each other after that EIP.

I would suggest postponing this PR until we don't have EIP implementation details. What do you think?

👍 I got your intention and I also agree with you. it will be absolutely better to proceed this PR after we get more details about the EIP.

Thanks. :)

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.

2 participants