-
-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-gossip bls changes if submitted earlier than capella (#5049)
* Cache and retransmit bls changes if submitted early * regossip when synced on/post capella * fix tests * modify publish vs cache condition * add logging * add error logging * batchify the processing * fix some of the cases * fix log issues * also delete included keys * fix lint * simplify gossip loop * fix build * refac to a versioned bls change store * update * logging improvements * improve logging and finish behavior * cleanup
- Loading branch information
Showing
7 changed files
with
123 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 6 additions & 5 deletions
11
packages/beacon-node/src/db/repositories/blsToExecutionChange.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
import {ValidatorIndex, capella, ssz} from "@lodestar/types"; | ||
import {ValidatorIndex} from "@lodestar/types"; | ||
import {IChainForkConfig} from "@lodestar/config"; | ||
import {Db, Bucket, Repository} from "@lodestar/db"; | ||
import {SignedBLSToExecutionChangeVersioned, signedBLSToExecutionChangeVersionedType} from "../../util/types.js"; | ||
|
||
export class BLSToExecutionChangeRepository extends Repository<ValidatorIndex, capella.SignedBLSToExecutionChange> { | ||
export class BLSToExecutionChangeRepository extends Repository<ValidatorIndex, SignedBLSToExecutionChangeVersioned> { | ||
constructor(config: IChainForkConfig, db: Db) { | ||
super(config, db, Bucket.capella_blsToExecutionChange, ssz.capella.SignedBLSToExecutionChange); | ||
super(config, db, Bucket.capella_blsToExecutionChange, signedBLSToExecutionChangeVersionedType); | ||
} | ||
|
||
getId(value: capella.SignedBLSToExecutionChange): ValidatorIndex { | ||
return value.message.validatorIndex; | ||
getId(value: SignedBLSToExecutionChangeVersioned): ValidatorIndex { | ||
return value.data.message.validatorIndex; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import {ContainerType, ValueOf} from "@chainsafe/ssz"; | ||
import {ssz} from "@lodestar/types"; | ||
|
||
// Misc SSZ types used only in the beacon-node package, no need to upstream to types | ||
|
||
export const signedBLSToExecutionChangeVersionedType = new ContainerType( | ||
{ | ||
// Assumes less than 256 forks, sounds reasonable in our lifetime | ||
preCapella: ssz.Boolean, | ||
data: ssz.capella.SignedBLSToExecutionChange, | ||
}, | ||
{jsonCase: "eth2", typeName: "SignedBLSToExecutionChangeVersionedType"} | ||
); | ||
export type SignedBLSToExecutionChangeVersioned = ValueOf<typeof signedBLSToExecutionChangeVersionedType>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters