-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Upgrade to tm version 23.0. #1927
Changes from 9 commits
7410bf6
c62380d
73b4bdd
57693b9
41d0355
2f85fff
4ee35d4
d130bbf
a107a80
7b52940
794a699
d2acf55
a27a43b
f44a487
c4b6c58
0e85025
161dfaa
7322cda
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -387,7 +387,8 @@ func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeg | |
} | ||
|
||
// set the signed validators for addition to context in deliverTx | ||
app.signedValidators = req.Validators | ||
// TODO: communicate this result to the address to pubkey map in slashing | ||
app.signedValidators = req.LastCommitInfo.GetValidators() | ||
return | ||
} | ||
|
||
|
@@ -412,11 +413,7 @@ func (app *BaseApp) CheckTx(txBytes []byte) (res abci.ResponseCheckTx) { | |
Log: result.Log, | ||
GasWanted: result.GasWanted, | ||
GasUsed: result.GasUsed, | ||
Fee: cmn.KI64Pair{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we getting rid of this? Presumably Tendermint needs to know about the fee? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fees were removed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, should we add priority then? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ValarDragon thoughts on the above? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No reason to add priority right now. We're not ready to support that at the mempool level, and we won't be for awhile. We discussed that priority is something we want to add as a way to test protobuf upgradability on a test net, not right now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gotcha. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, I think it's not necessary to delay ABCI updates because Tendermint won't use the value yet, but nbd. |
||
[]byte(result.FeeDenom), | ||
result.FeeAmount, | ||
}, | ||
Tags: result.Tags, | ||
Tags: result.Tags, | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,5 +44,5 @@ func SignTxRequstHandler(w http.ResponseWriter, r *http.Request) { | |
return | ||
} | ||
|
||
w.Write(sig.Bytes()) | ||
w.Write(sig) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ import ( | |
"os" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
|
||
tcrypto "github.com/tendermint/tendermint/crypto" | ||
|
@@ -15,15 +16,17 @@ type byter interface { | |
Bytes() []byte | ||
} | ||
|
||
func checkAminoBinary(t *testing.T, src byter, dst interface{}, size int) { | ||
func checkAminoBinary(t *testing.T, src, dst interface{}, size int) { | ||
// Marshal to binary bytes. | ||
bz, err := cdc.MarshalBinaryBare(src) | ||
require.Nil(t, err, "%+v", err) | ||
// Make sure this is compatible with current (Bytes()) encoding. | ||
require.Equal(t, src.Bytes(), bz, "Amino binary vs Bytes() mismatch") | ||
if byterSrc, ok := src.(byter); ok { | ||
// Make sure this is compatible with current (Bytes()) encoding. | ||
assert.Equal(t, byterSrc.Bytes(), bz, "Amino binary vs Bytes() mismatch") | ||
} | ||
// Make sure we have the expected length. | ||
if size != -1 { | ||
require.Equal(t, size, len(bz), "Amino binary size mismatch") | ||
assert.Equal(t, size, len(bz), "Amino binary size mismatch") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why assert instead of require? Wouldn't we want this to fail immediately? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was changing this to match whats in tendermint/crypto right now. I don't really have a preference here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's most important to be consistent -- it seems in SDK-land, the defacto call is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Its to use require unless there is any reason not to. There is good reason to not use it here if we had more pubkey types, but I guess we can change it when that happens. |
||
} | ||
// Unmarshal. | ||
err = cdc.UnmarshalBinaryBare(bz, dst) | ||
|
@@ -55,8 +58,6 @@ func ExamplePrintRegisteredTypes() { | |
//| PubKeySecp256k1 | tendermint/PubKeySecp256k1 | 0xEB5AE987 | 0x21 | | | ||
//| PrivKeyEd25519 | tendermint/PrivKeyEd25519 | 0xA3288910 | 0x40 | | | ||
//| PrivKeySecp256k1 | tendermint/PrivKeySecp256k1 | 0xE1B0F79B | 0x20 | | | ||
//| SignatureEd25519 | tendermint/SignatureEd25519 | 0x2031EA53 | 0x40 | | | ||
//| SignatureSecp256k1 | tendermint/SignatureSecp256k1 | 0x7FC4A495 | variable | | | ||
} | ||
|
||
func TestKeyEncodings(t *testing.T) { | ||
|
@@ -86,13 +87,11 @@ func TestKeyEncodings(t *testing.T) { | |
require.EqualValues(t, tc.privKey, priv3) | ||
|
||
// Check (de/en)codings of Signatures. | ||
var sig1, sig2, sig3 tcrypto.Signature | ||
var sig1, sig2 []byte | ||
sig1, err := tc.privKey.Sign([]byte("something")) | ||
require.NoError(t, err) | ||
checkAminoBinary(t, sig1, &sig2, -1) // Signature size changes for Secp anyways. | ||
require.EqualValues(t, sig1, sig2) | ||
checkAminoJSON(t, sig1, &sig3, false) // TODO also check Prefix bytes. | ||
require.EqualValues(t, sig1, sig3) | ||
|
||
// Check (de/en)codings of PubKeys. | ||
pubKey := tc.privKey.PubKey() | ||
|
@@ -107,7 +106,7 @@ func TestKeyEncodings(t *testing.T) { | |
func TestNilEncodings(t *testing.T) { | ||
|
||
// Check nil Signature. | ||
var a, b tcrypto.Signature | ||
var a, b []byte | ||
checkAminoJSON(t, &a, &b, true) | ||
require.EqualValues(t, a, b) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add the PR reference here (preferably with a link por favor)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why the PR is helpful. The tendermint changelog is what is helpful, I can link that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the SDK changed and that's important to note where/how it happened.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is a downside of our pending system, the commit with all the changes can't be obtained from the file. I'll link the PR then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'd just would like to see a
CHANGELOG
and be able to go to the issue and/or PR that made the relevant changes.