no fork, just new

This commit is contained in:
Cassandra Heart 2024-11-08 04:46:51 -06:00
parent b7d57270bb
commit b77fd36e2c
No known key found for this signature in database
GPG Key ID: 6352152859385958
4 changed files with 52 additions and 74 deletions

View File

@ -137,7 +137,7 @@ var unlock *SignedGenesisUnlock
func DownloadAndVerifyGenesis(network uint) (*SignedGenesisUnlock, error) {
if network != 0 {
unlock = &SignedGenesisUnlock{
GenesisSeedHex: "726573697374206d7563682c206f626579206c6974746c657c00000000000000000000000A",
GenesisSeedHex: "726573697374206d7563682c206f626579206c6974746c657c00000000000000000000000B",
Beacon: []byte{
0x58, 0xef, 0xd9, 0x7e, 0xdd, 0x0e, 0xb6, 0x2f,
0x51, 0xc7, 0x5d, 0x00, 0x29, 0x12, 0x45, 0x49,

View File

@ -40,5 +40,5 @@ func GetPatchNumber() byte {
}
func GetRCNumber() byte {
return 0x05
return 0x06
}

View File

@ -177,27 +177,22 @@ func (a *TokenApplication) handleMint(
zap.String("peer_id", base58.Encode([]byte(peerId))),
zap.Uint64("frame_number", currentFrameNumber),
)
// testnet only, this is inline for mainnet:
if currentFrameNumber > 1100 {
lockMap[string(t.Signature.PublicKey.KeyValue)] = struct{}{}
return []*protobufs.TokenOutput{&protobufs.TokenOutput{
Output: &protobufs.TokenOutput_Penalty{
Penalty: &protobufs.ProverPenalty{
Quantity: 10,
Account: &protobufs.AccountRef{
Account: &protobufs.AccountRef_ImplicitAccount{
ImplicitAccount: &protobufs.ImplicitAccount{
ImplicitType: 0,
Address: altAddr.FillBytes(make([]byte, 32)),
},
lockMap[string(t.Signature.PublicKey.KeyValue)] = struct{}{}
return []*protobufs.TokenOutput{&protobufs.TokenOutput{
Output: &protobufs.TokenOutput_Penalty{
Penalty: &protobufs.ProverPenalty{
Quantity: 10,
Account: &protobufs.AccountRef{
Account: &protobufs.AccountRef_ImplicitAccount{
ImplicitAccount: &protobufs.ImplicitAccount{
ImplicitType: 0,
Address: altAddr.FillBytes(make([]byte, 32)),
},
},
},
},
}}, nil
} else {
return nil, errors.Wrap(ErrInvalidStateTransition, "handle mint")
}
},
}}, nil
}
}
}
@ -211,27 +206,22 @@ func (a *TokenApplication) handleMint(
zap.String("peer_id", base58.Encode([]byte(peerId))),
zap.Uint64("frame_number", currentFrameNumber),
)
// testnet only, this is inline for mainnet:
if currentFrameNumber > 1100 {
lockMap[string(t.Signature.PublicKey.KeyValue)] = struct{}{}
return []*protobufs.TokenOutput{&protobufs.TokenOutput{
Output: &protobufs.TokenOutput_Penalty{
Penalty: &protobufs.ProverPenalty{
Quantity: 10,
Account: &protobufs.AccountRef{
Account: &protobufs.AccountRef_ImplicitAccount{
ImplicitAccount: &protobufs.ImplicitAccount{
ImplicitType: 0,
Address: altAddr.FillBytes(make([]byte, 32)),
},
lockMap[string(t.Signature.PublicKey.KeyValue)] = struct{}{}
return []*protobufs.TokenOutput{&protobufs.TokenOutput{
Output: &protobufs.TokenOutput_Penalty{
Penalty: &protobufs.ProverPenalty{
Quantity: 10,
Account: &protobufs.AccountRef{
Account: &protobufs.AccountRef_ImplicitAccount{
ImplicitAccount: &protobufs.ImplicitAccount{
ImplicitType: 0,
Address: altAddr.FillBytes(make([]byte, 32)),
},
},
},
},
}}, nil
} else {
return nil, errors.Wrap(ErrInvalidStateTransition, "handle mint")
}
},
}}, nil
}
if !verified {
@ -272,27 +262,22 @@ func (a *TokenApplication) handleMint(
zap.String("peer_id", base58.Encode([]byte(peerId))),
zap.Uint64("frame_number", currentFrameNumber),
)
// testnet only, this is inline for mainnet:
if currentFrameNumber > 1100 {
lockMap[string(t.Signature.PublicKey.KeyValue)] = struct{}{}
return []*protobufs.TokenOutput{&protobufs.TokenOutput{
Output: &protobufs.TokenOutput_Penalty{
Penalty: &protobufs.ProverPenalty{
Quantity: 10,
Account: &protobufs.AccountRef{
Account: &protobufs.AccountRef_ImplicitAccount{
ImplicitAccount: &protobufs.ImplicitAccount{
ImplicitType: 0,
Address: altAddr.FillBytes(make([]byte, 32)),
},
lockMap[string(t.Signature.PublicKey.KeyValue)] = struct{}{}
return []*protobufs.TokenOutput{&protobufs.TokenOutput{
Output: &protobufs.TokenOutput_Penalty{
Penalty: &protobufs.ProverPenalty{
Quantity: 10,
Account: &protobufs.AccountRef{
Account: &protobufs.AccountRef_ImplicitAccount{
ImplicitAccount: &protobufs.ImplicitAccount{
ImplicitType: 0,
Address: altAddr.FillBytes(make([]byte, 32)),
},
},
},
},
}}, nil
} else {
return nil, errors.Wrap(ErrInvalidStateTransition, "handle mint")
}
},
}}, nil
}
hash := sha3.Sum256(newFrame.Output)
pick := tries.BytesToUnbiasedMod(hash, uint64(parallelism))
@ -316,27 +301,22 @@ func (a *TokenApplication) handleMint(
zap.Uint64("frame_number", currentFrameNumber),
zap.Int("proof_size", len(leaf)),
)
// testnet only, this is inline for mainnet:
if currentFrameNumber > 1100 {
lockMap[string(t.Signature.PublicKey.KeyValue)] = struct{}{}
return []*protobufs.TokenOutput{&protobufs.TokenOutput{
Output: &protobufs.TokenOutput_Penalty{
Penalty: &protobufs.ProverPenalty{
Quantity: 10,
Account: &protobufs.AccountRef{
Account: &protobufs.AccountRef_ImplicitAccount{
ImplicitAccount: &protobufs.ImplicitAccount{
ImplicitType: 0,
Address: altAddr.FillBytes(make([]byte, 32)),
},
lockMap[string(t.Signature.PublicKey.KeyValue)] = struct{}{}
return []*protobufs.TokenOutput{&protobufs.TokenOutput{
Output: &protobufs.TokenOutput_Penalty{
Penalty: &protobufs.ProverPenalty{
Quantity: 10,
Account: &protobufs.AccountRef{
Account: &protobufs.AccountRef_ImplicitAccount{
ImplicitAccount: &protobufs.ImplicitAccount{
ImplicitType: 0,
Address: altAddr.FillBytes(make([]byte, 32)),
},
},
},
},
}}, nil
} else {
return nil, errors.Wrap(ErrInvalidStateTransition, "handle mint")
}
},
}}, nil
}
wesoProver := crypto.NewWesolowskiFrameProver(a.Logger)
@ -450,8 +430,7 @@ func (a *TokenApplication) handleMint(
},
},
)
// testnet only, this is inline for mainnet:
if !verified && currentFrameNumber > 1100 {
if !verified {
outputs = append(outputs, &protobufs.TokenOutput{
Output: &protobufs.TokenOutput_Penalty{
Penalty: &protobufs.ProverPenalty{

View File

@ -591,8 +591,7 @@ func (e *TokenExecutionEngine) ProcessFrame(
}
// testnet:
if len(o.Proof.Amount) == 32 &&
!bytes.Equal(o.Proof.Amount, make([]byte, 32)) &&
frame.FrameNumber > 1100 {
!bytes.Equal(o.Proof.Amount, make([]byte, 32)) {
addr := string(o.Proof.Owner.GetImplicitAccount().Address)
if _, ok := (*e.peerSeniority)[addr]; !ok {
(*e.peerSeniority)[addr] = peerSeniorityItem{