Skip to content

Commit

Permalink
chore: increase min stake for mainnet (#546)
Browse files Browse the repository at this point in the history
  • Loading branch information
aloknerurkar authored Dec 27, 2024
1 parent 38a385e commit 48897d2
Show file tree
Hide file tree
Showing 7 changed files with 633 additions and 637 deletions.
2 changes: 1 addition & 1 deletion contracts/scripts/core/DeployCore.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ contract DeployCore is Script {
function run() external {
vm.startBroadcast();

uint256 minStake = 1 ether;
uint256 minStake = 10 ether;
address protocolFeeRecipient = address(
0xfA0B0f5d298d28EFE4d35641724141ef19C05684 // Placeholder for now, L1 preconf.eth address
);
Expand Down
555 changes: 277 additions & 278 deletions p2p/gen/go/bidderapi/v1/bidderapi.pb.go

Large diffs are not rendered by default.

700 changes: 349 additions & 351 deletions p2p/gen/go/providerapi/v1/providerapi.pb.go

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions p2p/integrationtest/provider/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func (b *ProviderClient) CheckAndStake() (string, error) {

// Register a provider
_, err = b.client.Stake(context.Background(), &providerapiv1.StakeRequest{
Amount: "10000000000000000000",
Amount: "15000000000000000000",
BlsPublicKeys: []string{hex.EncodeToString(pubkeyb)},
BlsSignatures: []string{hex.EncodeToString(signature)},
})
Expand All @@ -169,7 +169,7 @@ func (b *ProviderClient) CheckAndStake() (string, error) {
return "", err
}

b.logger.Info("staked 10 ETH")
b.logger.Info("staked 15 ETH")

return hex.EncodeToString(pubkeyb), nil
}
Expand Down
2 changes: 1 addition & 1 deletion p2p/rpc/bidderapi/v1/bidderapi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ message Bid {
}, (buf.validate.field).cel = {
id: "amount",
message: "amount must be a valid integer.",
expression: "this.matches('^[0-9]+$') && uint(this) > 0"
expression: "this.matches('^[1-9][0-9]*$')"
}];
int64 block_number = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
description: "Max block number that the bidder wants to include the transaction in."
Expand Down
4 changes: 2 additions & 2 deletions p2p/rpc/providerapi/v1/providerapi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ message StakeRequest {
}, (buf.validate.field).cel = {
id: "amount",
message: "amount must be a valid integer.",
expression: "this.matches('^[0-9]+$') && uint(this) > 0"
expression: "this.matches('^[1-9][0-9]*$')"
}];
repeated string bls_public_keys = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
description: "BLS public keys of the provider."
Expand Down Expand Up @@ -152,7 +152,7 @@ message Bid {
}, (buf.validate.field).cel = {
id: "bid_amount",
message: "bid_amount must be a valid integer.",
expression: "this.matches('^[0-9]+$') && uint(this) > 0"
expression: "this.matches('^[1-9][0-9]*$')"
}];
int64 block_number = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
description: "Max block number that the bidder wants to include the transaction in."
Expand Down
3 changes: 1 addition & 2 deletions testing/pkg/tests/staking/staking.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,12 @@ func Run(ctx context.Context, cluster orchestrator.Orchestrator, cfg any) error
return fmt.Errorf("failed to get min stake: %w", err)
}

amount, set := big.NewInt(0).SetString(minStake.Amount, 10)
stakeAmount, set := big.NewInt(0).SetString(minStake.Amount, 10)
if !set {
l.Error("failed to parse min stake", "amount", minStake.Amount)
return fmt.Errorf("failed to parse min stake: %s", minStake.Amount)
}

stakeAmount := big.NewInt(0).Mul(amount, big.NewInt(10))
// Generate a BLS signature to verify
message := common.HexToAddress(p.EthAddress()).Bytes()
hashedMessage := crypto.Keccak256(message)
Expand Down

0 comments on commit 48897d2

Please sign in to comment.