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

Rebase peppermint branch to v0.38.5 #2

Merged
merged 138 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from 134 commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
0ff2b30
Added votes to header + added secp256k1 + other changes
vaibhavchellani May 10, 2019
c7d4c6e
updated import
vaibhavchellani May 13, 2019
aa42854
txHash fix+update canonical rep
vaibhavchellani Jun 10, 2019
a57b0d7
removed sig size
vaibhavchellani Jun 16, 2019
9df1177
docs: fix consensus spec formatting (#3804)
alexdupre Jul 15, 2019
9867a65
abci/server: recover from app panics in socket server (#3809)
ruseinov Jul 17, 2019
8da4350
abci/client: fix DATA RACE in gRPC client (#3798)
tac0turtle Jul 17, 2019
c264db3
docs: "Writing a built-in Tendermint Core application in Go" guide (#…
melekes Jul 18, 2019
7041001
libs: Remove db from tendermint in favor of tendermint/tm-cmn (#3811)
tac0turtle Jul 19, 2019
073cd11
docs: add A TOC to the Readme.md of ADR Section (#3820)
tac0turtle Jul 19, 2019
5d7e22a
rpc: make max_body_bytes and max_header_bytes configurable (#3818)
bluele Jul 20, 2019
17b69d4
p2p/conn: Add Bufferpool (#3664)
unclezoro Jul 22, 2019
5ed39fd
rpc: /broadcast_evidence (#3481)
melekes Jul 22, 2019
df6df61
mempool: make max_msg_bytes configurable (#3826)
bluele Jul 22, 2019
e89991c
rpc: return err if page is incorrect (less than 0 or greater than tot…
melekes Jul 23, 2019
abc3082
blockchain: Reorg reactor (#3561)
ancazamfir Jul 23, 2019
5d0e703
Renamed wire.go to codec.go (#3827)
tac0turtle Jul 23, 2019
0335add
docs: add guides to docs (#3830)
melekes Jul 24, 2019
ff9e08a
add staticcheck linting (#3828)
tac0turtle Jul 25, 2019
58c3e59
types: move MakeVote / MakeBlock functions (#3819)
tac0turtle Jul 25, 2019
55066ce
p2p: Fix error logging for connection stop (#3824)
melekes Jul 25, 2019
6d4f18a
p2p: Do not write 'Couldn't connect to any seeds' if there are no see…
folex Jul 25, 2019
5f6617d
docs: add a footer to guides (#3835)
melekes Jul 25, 2019
53fdcfd
docs: "Writing a Tendermint Core application in Kotlin (gRPC)" guide …
climber73 Jul 29, 2019
5c9d6d8
node: allow replacing existing p2p.Reactor(s) (#3846)
melekes Jul 30, 2019
513a32a
gocritic (1/2) (#3836)
tac0turtle Jul 30, 2019
8025d40
tm-cmn to tm-db (#3850)
tac0turtle Jul 31, 2019
d56fb6e
version tmdb (#3854)
tac0turtle Jul 31, 2019
aacc71d
txindexer: Refactor Tx Search Aggregation (#3851)
alexanderbez Jul 31, 2019
15878dc
release for v0.32.2
tac0turtle Jul 31, 2019
76f3db0
Merge PR #3860: Update log v0.32.2
tac0turtle Aug 1, 2019
86a581f
Merge branch 'master' into v0.32
melekes Aug 28, 2019
0ad70fb
Merge pull request #3926 from tendermint/anton/v0.32.3
ebuchman Aug 28, 2019
ff2308b
Merge pull request #4002 from tendermint/release/v0.32.4
ebuchman Sep 20, 2019
0354ea8
Fix for panic in signature verification if a peer sends a nil public …
zmanian Sep 20, 2019
d062869
update version.go
zmanian Sep 26, 2019
d6ea1ed
Changelog update
zmanian Sep 26, 2019
b08f655
Update CHANGELOG.md
Sep 28, 2019
0f111b3
update changelog
melekes Sep 30, 2019
ab62fd9
p2p: only allow ed25519 pubkeys when connecting
melekes Oct 8, 2019
88946fd
update changelog and bump version to v0.32.6
melekes Oct 8, 2019
c4ba93a
set the date to today
melekes Oct 8, 2019
470a23f
cs: panic only when WAL#WriteSync fails
melekes Oct 16, 2019
c207fa6
types: validate Part#Proof
melekes Oct 16, 2019
c38dbdb
cs: limit max bit array size and block parts count
melekes Oct 17, 2019
564d6a2
cs: test new limits
melekes Oct 17, 2019
7149485
cs: only assert important stuff
melekes Oct 17, 2019
b5cad43
update changelog and bump version to 0.32.7
melekes Oct 17, 2019
7ec2dff
fixes after Ethan's review
melekes Oct 19, 2019
c013501
align max wal msg and max consensus msg sizes
melekes Oct 23, 2019
7ffd3ff
fix tests
melekes Oct 23, 2019
7b67ee4
fix test
melekes Oct 23, 2019
94d7329
Merge tag 'v0.32.7' into peppermint-31.5
jdkanani Dec 23, 2019
141a717
use bor
jdkanani Dec 23, 2019
c743ff6
add data in commit
jdkanani Dec 26, 2019
9b2d312
remove votes from header
jdkanani Jan 5, 2020
39bc808
new: add proposal results in vote
jdkanani Apr 18, 2020
646076b
fix: go mod
jdkanani Apr 19, 2020
05a7957
new: add sidechannel proto objects
jdkanani Apr 19, 2020
edca16f
new: add begin side blocker and deliver side tx
jdkanani Apr 19, 2020
3629ded
new: add side tx results in begin side block
jdkanani Apr 20, 2020
9f2f9b4
add: add side tx results into request begin side-block
jdkanani Apr 20, 2020
e1550ee
chg: add address in sig object
jdkanani Apr 21, 2020
a118413
chg: add events in side block
jdkanani Apr 22, 2020
37d9389
chg: allow empty sig
jdkanani Apr 22, 2020
5b449d9
chg: add flag to execute side-tx while not syncing
jdkanani Apr 23, 2020
e69ded9
chg: remove data from vote
jdkanani Apr 24, 2020
565f655
fix: use last byte on bigendian bytes
jdkanani Apr 24, 2020
edc079e
fix: call sidetx result for string method
jdkanani Apr 29, 2020
0c39d2e
Merge pull request #8 from maticnetwork/sidechannel
jdkanani Jun 16, 2020
3ea059b
feat: add rollback feature
Mar 11, 2022
fafb424
Use bor version v0.2.16
0xKrishna Aug 2, 2022
9c20f60
Merge pull request #23 from maticnetwork/krishna/update-bor-version
0xKrishna Aug 3, 2022
2208a11
Change log level tag from a single character to a full word
cffls Sep 23, 2022
3e7c7f8
Merge pull request #25 from maticnetwork/log_tag_change
cffls Sep 23, 2022
2a4b4a5
consensus,scripts,state,store,types: change PartSetHeader total to ui…
Raneet10 Jul 19, 2023
d115834
Merge pull request #26 from maticnetwork/raneet10/pos-1645
Raneet10 Aug 7, 2023
a7e9709
libs/log: add warn log level (#27)
anshalshukla Aug 31, 2023
ea050d2
mardizzone/POS-1609: dev: chg: bump btcd dep and solve related issues
marcello33 Oct 4, 2023
85da6cb
mardizzone/POS-1609: dev: chg: solve vulnerabilities associated with …
marcello33 Oct 4, 2023
ab02946
mardizzone/POS-1609: dev: chg: update bor version and replace tm-db
marcello33 Oct 4, 2023
a166673
mardizzone/POS-1609: dev: chg: bump go version
marcello33 Oct 4, 2023
a50d41c
mardizzone/POS-1609: dev: chg: bump go version to latest patch
marcello33 Oct 4, 2023
d50af6e
Changed the value of default maxNumInboundPeers and maxNumOutboundPeers
VAIBHAVJINDAL3012 Oct 5, 2023
da9dfa1
Merge pull request #29 from maticnetwork/vaibhav/DefaultValueChange
VAIBHAVJINDAL3012 Oct 5, 2023
2bb6a83
Merge pull request #28 from maticnetwork/mardizzone/POS-1609
marcello33 Oct 5, 2023
7bceb90
made Stopping peer for error log as debig (#30)
pratikspatil024 Nov 2, 2023
5f94b7e
made dialing failed log as debug (#31)
pratikspatil024 Nov 2, 2023
2f132b9
Added log to print number of peers (#32)
pratikspatil024 Nov 6, 2023
a7573e8
peppermint: changes to crypto
sergio-mena Sep 4, 2023
60506c0
Modified NewFilePV to generate secp256k1
sergio-mena Sep 4, 2023
fe7d6d6
(temporarily) allow both tendermint/P*KeySecp256k1 and comet/P*KeySec…
sergio-mena Sep 4, 2023
63309b0
Forward-port disabled `MaxSignatureSize` checks (+ new ones needed)
sergio-mena Sep 4, 2023
d904d49
cherry pick secp256k1 migration commits + go mod tidy
Raneet10 Nov 9, 2023
1dfec6a
Merge remote-tracking branch 'peppermint/peppermint' into raneet10/pe…
Raneet10 Nov 16, 2023
637be25
blocksync,consensus,crypto,libs,types: fix tests and more conflicts
Raneet10 Nov 20, 2023
2c33c46
consensus,libs,types: fix tests, vulns from govuln and some lint errors
Raneet10 Nov 21, 2023
0bdcced
ci: bump go version to 1.21.4
Raneet10 Nov 21, 2023
aad2b34
Fixed `TestPubKeySecp256k1Address`
sergio-mena Nov 17, 2023
b45920d
crypto: enforce curve group order checks in genPrivKey
Raneet10 Nov 21, 2023
d8d62a0
Merge branch 'raneet10/secp25k1-changes' into raneet10/peppermint-cha…
Raneet10 Nov 21, 2023
a5be190
abci,crypto: fix conflicts and tests
Raneet10 Nov 22, 2023
b2134e0
types: fix TestInvalidPrecommitExtensions
Raneet10 Nov 22, 2023
ec2c7b0
fix lint
Raneet10 Nov 24, 2023
b301c01
Extend kvstore example add with with key types
sergio-mena Nov 23, 2023
6479a06
Fix `TestReactorValidatorSetChanges`
sergio-mena Nov 23, 2023
1adf0cc
Fix UTs in `execution_test.go`
sergio-mena Nov 23, 2023
b6c7c63
Fix `TestEvidencePoolBasic`
sergio-mena Nov 23, 2023
f88b324
Fix `TestVoteExtension`
sergio-mena Nov 23, 2023
b3b70f3
test/e2e: use go 1.21.4 in docker
Raneet10 Nov 28, 2023
8648e45
test/e2e: use secp256k1 as default key type in testnet setup
Raneet10 Nov 28, 2023
9e607e8
p2p/conn: use secp256k1 for p2p authentication
Raneet10 Nov 28, 2023
9050f99
p2p/conn: allow both secp256k1 and ed25519 key types for authentication
Raneet10 Nov 28, 2023
bf3a0cf
all: address PR comments
Raneet10 Feb 2, 2024
86c34c2
types,blocksync: fix lint + tests + bump deps complained by govuln
Raneet10 Feb 3, 2024
8a94524
crypto,state,test: resolve conflicts from v0.38.5
Raneet10 Feb 5, 2024
2d738ce
abci: resolve conflicts from v0.38.5
Raneet10 Feb 5, 2024
e404e0f
resolve go mod deps
Raneet10 Feb 5, 2024
2706fc9
Merge branch 'v0.38.5-upstream' into raneet10/peppermint-changes
Raneet10 Feb 5, 2024
fc56973
Revert "Merge branch 'v0.38.5-upstream' into raneet10/peppermint-chan…
Raneet10 Feb 5, 2024
31d8071
Revert "Revert "Merge branch 'v0.38.5-upstream' into raneet10/pepperm…
Raneet10 Feb 5, 2024
0aaa933
all: fix issue from merge
Raneet10 Feb 5, 2024
fe97472
docs: remove Warn log definition from ADR
Raneet10 Feb 5, 2024
94b13af
state: remove outdated comments
Raneet10 Feb 8, 2024
ec89035
types: increase MaxSignatureSize to 65 and unskip related tests
Raneet10 Feb 8, 2024
705978c
cmd: minor refactor
Raneet10 Feb 8, 2024
572fac2
libs/protoio: minor refactor
Raneet10 Feb 8, 2024
7dd6ddb
libs/pubsub: minor refactor
Raneet10 Feb 8, 2024
918b8d8
state: minor refactor
Raneet10 Feb 8, 2024
7bfb667
state: minor restructure in test
Raneet10 Feb 8, 2024
e286a8b
types: fix TestMaxCommitBytes + lint
Raneet10 Feb 8, 2024
ea329c1
state,types: fix TestTxFilter and TestBlockMaxDataBytes
Raneet10 Feb 8, 2024
3996328
types: fix TestBlockMaxDataBytesNoEvidence
Raneet10 Feb 8, 2024
b274f1f
types: fix TestInvalidPrecommitExtensions
Raneet10 Feb 8, 2024
63d4874
abci,types: address comments
Raneet10 Feb 9, 2024
d81a33c
crypto,proto: add secp256k1_uncompressed oneof in PublicKey proto mes…
Raneet10 Feb 14, 2024
236d0d0
remove revive from .golangci.yml
Raneet10 Mar 1, 2024
de0bd99
remove replace of go-ethereum dep with bor and go mod tidy
Raneet10 Mar 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions abci/types/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ func ToRequestFinalizeBlock(req *RequestFinalizeBlock) *Request {
}
}

//----------------------------------------
Raneet10 marked this conversation as resolved.
Show resolved Hide resolved

func ToResponseException(errStr string) *Response {
return &Response{
Value: &Response_Exception{&ResponseException{Error: errStr}},
Expand Down
6 changes: 6 additions & 0 deletions crypto/encoding/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ func PubKeyToProto(k crypto.PubKey) (pc.PublicKey, error) {
Secp256K1: k,
},
}
case secp256k1.PubKeyOld:
Raneet10 marked this conversation as resolved.
Show resolved Hide resolved
kp = pc.PublicKey{
Sum: &pc.PublicKey_Secp256K1{
Secp256K1: k,
},
}
default:
return kp, fmt.Errorf("toproto: key type %v is not supported", k)
}
Expand Down
143 changes: 79 additions & 64 deletions crypto/secp256k1/secp256k1.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ import (
"math/big"

secp256k1 "github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/btcec/v2/ecdsa"
"golang.org/x/crypto/ripemd160" //nolint: staticcheck // necessary for Bitcoin address format
ethCrypto "github.com/ethereum/go-ethereum/crypto" //nolint:depguard
Raneet10 marked this conversation as resolved.
Show resolved Hide resolved

"github.com/cometbft/cometbft/crypto"
cmtjson "github.com/cometbft/cometbft/libs/json"
)

// -------------------------------------
const (
PrivKeyName = "tendermint/PrivKeySecp256k1"
PubKeyName = "tendermint/PubKeySecp256k1"
PrivKeyNameOld = "tendermint/PrivKeySecp256k1"
Raneet10 marked this conversation as resolved.
Show resolved Hide resolved
PubKeyNameOld = "tendermint/PubKeySecp256k1"
PrivKeyName = "comet/PrivKeySecp256k1Uncompressed"
PubKeyName = "comet/PubKeySecp256k1Uncompressed"

KeyType = "secp256k1"
PrivKeySize = 32
Expand All @@ -28,13 +29,34 @@ const (
func init() {
cmtjson.RegisterType(PubKey{}, PubKeyName)
cmtjson.RegisterType(PrivKey{}, PrivKeyName)
cmtjson.RegisterType(PubKeyOld{}, PubKeyNameOld)
cmtjson.RegisterType(PrivKeyOld{}, PrivKeyNameOld)
}

var _ crypto.PrivKey = PrivKey{}
var _ crypto.PrivKey = PrivKeyOld{}

// PrivKey implements PrivKey.
type PrivKey []byte

type PrivKeyOld []byte

func (privKey PrivKeyOld) Bytes() []byte {
return PrivKey(privKey).Bytes()
}
func (privKey PrivKeyOld) PubKey() crypto.PubKey {
return PrivKey(privKey).PubKey()
}
func (privKey PrivKeyOld) Equals(other crypto.PrivKey) bool {
return PrivKey(privKey).Equals(other)
}
func (privKey PrivKeyOld) Type() string {
return PrivKey(privKey).Type()
}
func (privKey PrivKeyOld) Sign(msg []byte) ([]byte, error) {
return PrivKey(privKey).Sign(msg)
}

// Bytes marshalls the private key using amino encoding.
func (privKey PrivKey) Bytes() []byte {
return []byte(privKey)
Expand All @@ -43,11 +65,14 @@ func (privKey PrivKey) Bytes() []byte {
// PubKey performs the point-scalar multiplication from the privKey on the
// generator point to get the pubkey.
func (privKey PrivKey) PubKey() crypto.PubKey {
_, pubkeyObject := secp256k1.PrivKeyFromBytes(privKey)

pk := pubkeyObject.SerializeCompressed()
privateObject, err := ethCrypto.ToECDSA(privKey)
if err != nil {
panic(err)
}

pk := ethCrypto.FromECDSAPub(&privateObject.PublicKey)
return PubKey(pk)

}

// Equals - you probably don't need to use this.
Expand Down Expand Up @@ -75,20 +100,21 @@ func genPrivKey(rand io.Reader) PrivKey {
d := new(big.Int)

for {
privKeyBytes = [PrivKeySize]byte{}
_, err := io.ReadFull(rand, privKeyBytes[:])
if err != nil {
panic(err)
}

d.SetBytes(privKeyBytes[:])
// break if we found a valid point (i.e. > 0 and < N == curverOrder)
// break if we found a valid point (i.e. > 0 and < N == curveOrder)
isValidFieldElement := 0 < d.Sign() && d.Cmp(secp256k1.S256().N) < 0
if isValidFieldElement {
break
}
}

// crypto.CRandBytes is guaranteed to be 32 bytes long, so it can be
// casted to PrivKey.
return PrivKey(privKeyBytes[:])
}

Expand Down Expand Up @@ -124,47 +150,64 @@ func GenPrivKeySecp256k1(secret []byte) PrivKey {
}

// Sign creates an ECDSA signature on curve Secp256k1, using SHA256 on the msg.
// The returned signature will be of the form R || S (in lower-S form).
// The returned signature will be of the form R || S || V (in lower-S form).
func (privKey PrivKey) Sign(msg []byte) ([]byte, error) {
priv, _ := secp256k1.PrivKeyFromBytes(privKey)

sig, err := ecdsa.SignCompact(priv, crypto.Sha256(msg), false)
privateObject, err := ethCrypto.ToECDSA(privKey)
if err != nil {
return nil, err
}

// remove the first byte which is compactSigRecoveryCode
return sig[1:], nil
return ethCrypto.Sign(ethCrypto.Keccak256(msg), privateObject)
}

//-------------------------------------

var _ crypto.PubKey = PubKey{}
var _ crypto.PubKey = PubKeyOld{}

// PubKeySize (uncompressed) is comprised of 65 bytes for two field elements (x and y)
// and a prefix byte (0x04) to indicate that it is uncompressed.
const PubKeySize = 65

// PubKeySize is comprised of 32 bytes for one field element
// (the x-coordinate), plus one byte for the parity of the y-coordinate.
const PubKeySize = 33
// SigSize is the size of the ECDSA signature.
const SigSize = 65

// PubKey implements crypto.PubKey.
// It is the compressed form of the pubkey. The first byte depends is a 0x02 byte
// if the y-coordinate is the lexicographically largest of the two associated with
// the x-coordinate. Otherwise the first byte is a 0x03.
// This prefix is followed with the x-coordinate.
// It is the uncompressed form of the pubkey. The first byte is prefixed with 0x04.
// This prefix is followed with the (x,y)-coordinates.
type PubKey []byte
type PubKeyOld []byte

func (pubKey PubKeyOld) Address() crypto.Address {
return PubKey(pubKey).Address()
}

func (pubKey PubKeyOld) Bytes() []byte {
return PubKey(pubKey).Bytes()
}

func (pubKey PubKeyOld) String() string {
return PubKey(pubKey).String()
}

// Address returns a Bitcoin style addresses: RIPEMD160(SHA256(pubkey))
func (pubKey PubKeyOld) Equals(other crypto.PubKey) bool {
return PubKey(pubKey).Equals(other)
}

func (pubKey PubKeyOld) Type() string {
return PubKey(pubKey).Type()
}

func (pubKey PubKeyOld) VerifySignature(msg []byte, sigStr []byte) bool {
return PubKey(pubKey).VerifySignature(msg, sigStr)
}

// Address returns a Ethereym style addresses: Last_20_Bytes(KECCAK256(pubkey))
func (pubKey PubKey) Address() crypto.Address {
if len(pubKey) != PubKeySize {
Raneet10 marked this conversation as resolved.
Show resolved Hide resolved
panic("length of pubkey is incorrect")
panic(fmt.Sprintf("length of pubkey is incorrect %d != %d", len(pubKey), PubKeySize))
}
hasherSHA256 := sha256.New()
_, _ = hasherSHA256.Write(pubKey) // does not error
sha := hasherSHA256.Sum(nil)

hasherRIPEMD160 := ripemd160.New()
_, _ = hasherRIPEMD160.Write(sha) // does not error

return crypto.Address(hasherRIPEMD160.Sum(nil))
return crypto.Address(ethCrypto.Keccak256(pubKey[1:])[12:])
}

// Bytes returns the pubkey marshaled with amino encoding.
Expand All @@ -187,41 +230,13 @@ func (pubKey PubKey) Type() string {
return KeyType
}

// VerifySignature verifies a signature of the form R || S.
// VerifySignature verifies a signature of the form R || S || V.
// It rejects signatures which are not in lower-S form.
func (pubKey PubKey) VerifySignature(msg []byte, sigStr []byte) bool {
if len(sigStr) != 64 {
if len(sigStr) != SigSize {
return false
}

pub, err := secp256k1.ParsePubKey(pubKey)
if err != nil {
return false
}

// parse the signature:
signature := signatureFromBytes(sigStr)
// Reject malleable signatures. libsecp256k1 does this check but btcec doesn't.
// see: https://github.com/ethereum/go-ethereum/blob/f9401ae011ddf7f8d2d95020b7446c17f8d98dc1/crypto/signature_nocgo.go#L90-L93
// Serialize() would negate S value if it is over half order.
// Hence, if the signature is different after Serialize() if should be rejected.
var modifiedSignature, parseErr = ecdsa.ParseDERSignature(signature.Serialize())
if parseErr != nil {
return false
}
if !signature.IsEqual(modifiedSignature) {
return false
}

return signature.Verify(crypto.Sha256(msg), pub)
}

// Read Signature struct from R || S. Caller needs to ensure
// that len(sigStr) == 64.
func signatureFromBytes(sigStr []byte) *ecdsa.Signature {
var r secp256k1.ModNScalar
r.SetByteSlice(sigStr[:32])
var s secp256k1.ModNScalar
s.SetByteSlice(sigStr[32:64])
return ecdsa.NewSignature(&r, &s)
hash := ethCrypto.Keccak256(msg)
return ethCrypto.VerifySignature(pubKey, hash, sigStr[:64])
}
17 changes: 14 additions & 3 deletions crypto/secp256k1/secp256k1_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ import (
"math/big"
"testing"

"github.com/stretchr/testify/require"

secp256k1 "github.com/btcsuite/btcd/btcec/v2"
"github.com/stretchr/testify/require"
)

func Test_genPrivKey(t *testing.T) {

empty := make([]byte, 32)
oneB := big.NewInt(1).Bytes()
onePadded := make([]byte, 32)
Expand Down Expand Up @@ -82,3 +80,16 @@ func TestSignatureVerificationAndRejectUpperS(t *testing.T) {
)
}
}

func TestGenEthPrivKey(t *testing.T) {
msg := []byte("We have lingered long enough on the shores of the cosmic ocean.")
priv := GenPrivKey()
t.Log("privkey ", priv)
sigStr, err := priv.Sign(msg)
require.NoError(t, err)
pub := priv.PubKey()
addr := pub.Address()
t.Log("address ", addr)
t.Log("pub ", pub)
t.Log("SigStr ", sigStr)
}
4 changes: 2 additions & 2 deletions crypto/secp256k1/secp256k1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ type keyData struct {
var secpDataTable = []keyData{
{
priv: "a96e62ed3955e65be32703f12d87b6b5cf26039ecfa948dc5107a495418e5330",
pub: "02950e1cdfcb133d6024109fd489f734eeb4502418e538c28481f22bce276f248c",
Raneet10 marked this conversation as resolved.
Show resolved Hide resolved
addr: "1CKZ9Nx4zgds8tU7nJHotKSDr4a9bYJCa3",
pub: "04950e1cdfcb133d6024109fd489f734eeb4502418e538c28481f22bce276f248ca0ca66092c9fe8adfbb8424bd92f26e170234c42df756075278ead79a8f5c4ae",
addr: "1PrkgVnuHLGZu4EUQGmXkGVuhTfn7t8DJK",
},
}

Expand Down
2 changes: 1 addition & 1 deletion evidence/pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func TestEvidencePoolBasic(t *testing.T) {
next := pool.EvidenceFront()
assert.Equal(t, ev, next.Value.(types.Evidence))

const evidenceBytes int64 = 372
const evidenceBytes int64 = 374
Raneet10 marked this conversation as resolved.
Show resolved Hide resolved
evs, size = pool.PendingEvidence(evidenceBytes)
assert.Equal(t, 1, len(evs))
assert.Equal(t, evidenceBytes, size) // check that the size of the single evidence in bytes is correct
Expand Down
16 changes: 5 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ require (
github.com/btcsuite/btcd/btcutil v1.1.3
github.com/cometbft/cometbft-db v0.7.0
github.com/cosmos/gogoproto v1.4.11
github.com/ethereum/go-ethereum v1.13.4
github.com/go-git/go-git/v5 v5.11.0
github.com/gofrs/uuid v4.4.0+incompatible
github.com/google/uuid v1.4.0
Expand Down Expand Up @@ -103,7 +104,7 @@ require (
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/docker/cli v23.0.1+incompatible // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/docker v23.0.1+incompatible // indirect
github.com/docker/docker v24.0.5+incompatible // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
Expand Down Expand Up @@ -140,7 +141,7 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.1.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 // indirect
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect
github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe // indirect
Expand All @@ -165,6 +166,7 @@ require (
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hexops/gotextdiff v1.0.3 // indirect
github.com/holiman/uint256 v1.2.3 // indirect
github.com/iancoleman/strcase v0.2.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
Expand Down Expand Up @@ -287,19 +289,11 @@ require (
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools v2.2.0+incompatible // indirect
honnef.co/go/tools v0.4.3 // indirect
mvdan.cc/gofumpt v0.4.0 // indirect
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect
mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d // indirect
)

retract (
Raneet10 marked this conversation as resolved.
Show resolved Hide resolved
// a regression was introduced
v0.38.4
// a breaking change was introduced
v0.38.3
// superseeded by v0.38.3 because of ASA-2024-001
[v0.38.0, v0.38.2]
)
replace github.com/ethereum/go-ethereum => github.com/maticnetwork/bor v1.0.4
Raneet10 marked this conversation as resolved.
Show resolved Hide resolved
Loading
Loading