cosmos / cosmos-sdk

:chains: A Framework for Building High Value Public Blockchains :sparkles:
https://cosmos.network/
Apache License 2.0
6.27k stars 3.63k forks source link

bug(store,x/distribution): Rounding error in rewards claim when using QueryContext. #15533

Open itsdevbear opened 1 year ago

itsdevbear commented 1 year ago

Summary of Bug

When testing the EstimateGas for stateful precompiles in Polaris (https://github.com/berachain/polaris) we experienced a strange phenonemum where the estimated gas when using a QueryContext vs the canonical DeliverStateContxt resulted in two different numbers for the consumed gas. For context, Polaris supports stateful precompile evm contracts, which allows for smart contracts in our EVM to call Cosmos-SDK modules directly, in this example we are using x/staking (and by proxy x/distribution).

This difference in rounding lead to situations where our Ethereum JSON-RPC's Estimate Gas was reporting a lower required gas then what is actually required to execute the transaction leading to failed transactions. Most notably this occurs when a user tries to call delegate(). Part of delegating to a validator in the SDK requires withdrawing outstanding rewards in order to allow the passive distribution math ot functional. Notably, on an alternating fashion, we saw that when using the QueryContext the pending rewards for a user was 0, leading to the following control flow to be skipped (https://github.com/cosmos/cosmos-sdk/blob/ba9d4df6d0d1e8b28631459090b50f8da6aa71b0/x/distribution/keeper/delegation.go#L170) The rewards being 0 (when they shouldnt be) causes the control flow to skip calling into the bank module and thus consumes less gas. This estimated gas is then utilized when the transaciton is submitted on chain, in which the outstanding is no 0, the control flow enters the bank module, consuming the extra gas and resulting in an evm out of gas error.

Here is a link to the issue in our repo: https://github.com/berachain/polaris/issues/480

@tac0turtle and I have chatted a bit and he thinks that it may be a caching issue with the QueryContext and/or the Root Multistore, but would love others thoughts on this for sure.

Version

From our go.mod

module pkg.berachain.dev/polaris/cosmos

go 1.20

replace (
    cosmossdk.io/x/evidence => cosmossdk.io/x/evidence v0.0.0-20230305125317-672b052f323b
    cosmossdk.io/x/feegrant => cosmossdk.io/x/feegrant v0.0.0-20230305125317-672b052f323b
    github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230305125317-672b052f323b
    github.com/docker/docker => github.com/docker/docker v20.10.3-0.20221013203545-33ab36d6b304+incompatible // 22.06 branch
    // Required for stateful precompiles and supporting the Ethereum JSON-RPC API.
    github.com/ethereum/go-ethereum => github.com/berachain/polaris-geth v0.0.0-20230320232033-db2035009c47
    github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
)

require (
    cosmossdk.io/api v0.3.1
    cosmossdk.io/client/v2 v2.0.0-20230220152935-67f04e629623
    cosmossdk.io/core v0.6.0
    cosmossdk.io/depinject v1.0.0-alpha.3
    cosmossdk.io/errors v1.0.0-beta.7
    cosmossdk.io/log v0.0.0-20230305202224-89c956f8ed3a
    cosmossdk.io/math v1.0.0-beta.6.0.20230305125317-672b052f323b
    cosmossdk.io/simapp v0.0.0-20230305125317-672b052f323b
    cosmossdk.io/store v0.0.0-20230305125317-672b052f323b
    cosmossdk.io/tools/confix v0.0.0-20230227140543-7c9245dbdf19
    cosmossdk.io/x/evidence v0.1.0
    cosmossdk.io/x/feegrant v0.0.0-20230305125317-672b052f323b
    cosmossdk.io/x/upgrade v0.0.0-20230305125317-672b052f323b
    //........
)

Steps to Reproduce

  1. Clone Polaris, Setup dependecies and run mage start (this will start a chain)
  2. Run the following commands using foundry cast
  3. View the following result and the lack of inclusion in the EVM chains block. Due to out-of-gas error (which can be seen in the terminal logs for the chain)
cast estimate 0xd9A998CaC66092748FfEc7cFBD155Aae1737C2fF "delegate(address,uint256)" 0xcB6600d6cCdd50474926A955B920E91eC9Eb4Db1 123 --from 0x20f33CE90A13a4b5E7697E3544c3083B8F8A51D4
131760
cast send 0xd9A998CaC66092748FfEc7cFBD155Aae1737C2fF "delegate(address,uint256)" 0xcB6600d6cCdd50474926A955B920E91eC9Eb4Db1 123 --private-key 0xfffdbb37105441e14b0ee6330d855d8504ff39e705c3afa8f859ac9865f99306 --gas-limit 115000

blockHash               0xe407faa1253ca2d916eb6a1f444dc404c6f4188db029b94d295a175d35a039c1
blockNumber             248
contractAddress
cumulativeGasUsed       115000
effectiveGasPrice
gasUsed                 115000
logs                    []
logsBloom               0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
root
status                  0
transactionHash         0x30824d4a026fe2a30272f79180e6d9e2673d46a57eb4ee33be40d7b701cdde81
transactionIndex        0
type                    2
cast estimate 0xd9A998CaC66092748FfEc7cFBD155Aae1737C2fF "delegate(address,uint256)" 0xcB6600d6cCdd50474926A955B920E91eC9Eb4Db1 123 --from 0x20f33CE90A13a4b5E7697E3544c3083B8F8A51D4
131760
cast send 0xd9A998CaC66092748FfEc7cFBD155Aae1737C2fF "delegate(address,uint256)" 0xcB6600d6cCdd50474926A955B920E91eC9Eb4Db1 123 --private-key 0xfffdbb37105441e14b0ee6330d855d8504ff39e705c3afa8f859ac9865f99306 --gas-limit 131760

blockHash               0x2179de87b08ea53de72839b3dc913d4bf8fe860f0c2d72d04e57c00331f0dafe
blockNumber             270
contractAddress
cumulativeGasUsed       131760
effectiveGasPrice
gasUsed                 131760
logs                    [{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0xcd91156b4607a66e03194df5423537108085ebd28cca92794de7e9c53bd4c1c7","0x00000000000000000000000093354845030274cd4bf1686abd60ab28ec52e1a7"],"data":"0x00000000000000000000000000000000000000000000000000000000000000b9","blockHash":"0xc65bec11ea5f2c9e25a2107578428410f47ec2c6adbc922661674ba51b6d9408","blockNumber":"0x10e","transactionHash":"0x8d495eff32d9885287cfc5308b03bde4065fee0de240131a7bbd81bd0c9e8829","transactionIndex":"0x0","logIndex":"0x0","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0xb2217585c246e507e3fcadd4d32d0177479d19c83452fabed3d7650cac3b0420","0x00000000000000000000000020f33ce90a13a4b5e7697e3544c3083b8f8a51d4"],"data":"0x00000000000000000000000000000000000000000000000000000000000000b9","blockHash":"0xc65bec11ea5f2c9e25a2107578428410f47ec2c6adbc922661674ba51b6d9408","blockNumber":"0x10e","transactionHash":"0x8d495eff32d9885287cfc5308b03bde4065fee0de240131a7bbd81bd0c9e8829","transactionIndex":"0x0","logIndex":"0x1","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0x69ca02dd4edd7bf0a4abb9ed3b7af3f14778db5d61921c7dc7cd545266326de2","0x00000000000000000000000020f33ce90a13a4b5e7697e3544c3083b8f8a51d4"],"data":"0x00000000000000000000000000000000000000000000000000000000000000b9","blockHash":"0xc65bec11ea5f2c9e25a2107578428410f47ec2c6adbc922661674ba51b6d9408","blockNumber":"0x10e","transactionHash":"0x8d495eff32d9885287cfc5308b03bde4065fee0de240131a7bbd81bd0c9e8829","transactionIndex":"0x0","logIndex":"0x2","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0x516772d06520d23d2705f0b46a1fa6deec0ae36a2c00db049bd5f4094a123b85","0x00000000000000000000000093354845030274cd4bf1686abd60ab28ec52e1a7"],"data":"0x","blockHash":"0xc65bec11ea5f2c9e25a2107578428410f47ec2c6adbc922661674ba51b6d9408","blockNumber":"0x10e","transactionHash":"0x8d495eff32d9885287cfc5308b03bde4065fee0de240131a7bbd81bd0c9e8829","transactionIndex":"0x0","logIndex":"0x3","removed":false},{"address":"0x93354845030274cd4bf1686abd60ab28ec52e1a7","topics":["0xaa1377f7ec93c239e959efa811f7b8554c036fd7a706c23e58024626a8f3db96","0x000000000000000000000000cb6600d6ccdd50474926a955b920e91ec9eb4db1"],"data":"0x00000000000000000000000000000000000000000000000000000000000000b9","blockHash":"0xc65bec11ea5f2c9e25a2107578428410f47ec2c6adbc922661674ba51b6d9408","blockNumber":"0x10e","transactionHash":"0x8d495eff32d9885287cfc5308b03bde4065fee0de240131a7bbd81bd0c9e8829","transactionIndex":"0x0","logIndex":"0x4","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0xcd91156b4607a66e03194df5423537108085ebd28cca92794de7e9c53bd4c1c7","0x00000000000000000000000020f33ce90a13a4b5e7697e3544c3083b8f8a51d4"],"data":"0x000000000000000000000000000000000000000000000000000000000000007b","blockHash":"0xc65bec11ea5f2c9e25a2107578428410f47ec2c6adbc922661674ba51b6d9408","blockNumber":"0x10e","transactionHash":"0x8d495eff32d9885287cfc5308b03bde4065fee0de240131a7bbd81bd0c9e8829","transactionIndex":"0x0","logIndex":"0x5","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0xb2217585c246e507e3fcadd4d32d0177479d19c83452fabed3d7650cac3b0420","0x0000000000000000000000004fea76427b8345861e80a3540a8a9d936fd39391"],"data":"0x000000000000000000000000000000000000000000000000000000000000007b","blockHash":"0xc65bec11ea5f2c9e25a2107578428410f47ec2c6adbc922661674ba51b6d9408","blockNumber":"0x10e","transactionHash":"0x8d495eff32d9885287cfc5308b03bde4065fee0de240131a7bbd81bd0c9e8829","transactionIndex":"0x0","logIndex":"0x6","removed":false},{"address":"0xd9a998cac66092748ffec7cfbd155aae1737c2ff","topics":["0xb0d234274aef7a61aa5a2eb44c23881ebf46a068cccbd413c978bcbd555fe17f","0x000000000000000000000000cb6600d6ccdd50474926a955b920e91ec9eb4db1"],"data":"0x000000000000000000000000000000000000000000000000000000000000007b","blockHash":"0xc65bec11ea5f2c9e25a2107578428410f47ec2c6adbc922661674ba51b6d9408","blockNumber":"0x10e","transactionHash":"0x8d495eff32d9885287cfc5308b03bde4065fee0de240131a7bbd81bd0c9e8829","transactionIndex":"0x0","logIndex":"0x7","removed":false}]
logsBloom               0x00000000000020000000000000000300000002000000000000000002800000002000000000020000000000000000000000280600000200000000000000000000000000000008800000000000800000000000000000000000000000000000040502000000200000000000000000000000000000000000000000000000000008000000000040000010000000200000000000000000000000000000000000000000000010080000000000000008000000000000000082000000000000000000000020000000000000000000000000000000000400000000000001800000000000000000000000000000000000000000000000200008000008000020000000000020
root
status                  1
transactionHash         0x8d495eff32d9885287cfc5308b03bde4065fee0de240131a7bbd81bd0c9e8829
transactionIndex        0
type                    2
cast send 0xd9A998CaC66092748FfEc7cFBD155Aae1737C2fF "delegate(address,uint256)" 0xcB6600d6cCdd50474926A955B920E91eC9Eb4Db1 123 --private-key 0xfffdbb37105441e14b0ee6330d855d8504ff39e705c3afa8f859ac9865f99306 --gas-limit 131760

blockHash               0xba4ba63e0cd97316f876d668abfb19944848e4d0dc0cff72e9075ad9903e657a
blockNumber             276
contractAddress
cumulativeGasUsed       131757
effectiveGasPrice
gasUsed                 131757
logs                    [{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0xcd91156b4607a66e03194df5423537108085ebd28cca92794de7e9c53bd4c1c7","0x00000000000000000000000093354845030274cd4bf1686abd60ab28ec52e1a7"],"data":"0x0000000000000000000000000000000000000000000000000000000000000013","blockHash":"0xd775bdceed6afbcfee31a5718c41ff4369fc66ba2a7d32e31af69555d8c92c27","blockNumber":"0x114","transactionHash":"0x05378d01c90c20572b904bfe25239367cb4951e4b2e186f74e42c376b6baa7a5","transactionIndex":"0x0","logIndex":"0x0","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0xb2217585c246e507e3fcadd4d32d0177479d19c83452fabed3d7650cac3b0420","0x00000000000000000000000020f33ce90a13a4b5e7697e3544c3083b8f8a51d4"],"data":"0x0000000000000000000000000000000000000000000000000000000000000013","blockHash":"0xd775bdceed6afbcfee31a5718c41ff4369fc66ba2a7d32e31af69555d8c92c27","blockNumber":"0x114","transactionHash":"0x05378d01c90c20572b904bfe25239367cb4951e4b2e186f74e42c376b6baa7a5","transactionIndex":"0x0","logIndex":"0x1","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0x69ca02dd4edd7bf0a4abb9ed3b7af3f14778db5d61921c7dc7cd545266326de2","0x00000000000000000000000020f33ce90a13a4b5e7697e3544c3083b8f8a51d4"],"data":"0x0000000000000000000000000000000000000000000000000000000000000013","blockHash":"0xd775bdceed6afbcfee31a5718c41ff4369fc66ba2a7d32e31af69555d8c92c27","blockNumber":"0x114","transactionHash":"0x05378d01c90c20572b904bfe25239367cb4951e4b2e186f74e42c376b6baa7a5","transactionIndex":"0x0","logIndex":"0x2","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0x516772d06520d23d2705f0b46a1fa6deec0ae36a2c00db049bd5f4094a123b85","0x00000000000000000000000093354845030274cd4bf1686abd60ab28ec52e1a7"],"data":"0x","blockHash":"0xd775bdceed6afbcfee31a5718c41ff4369fc66ba2a7d32e31af69555d8c92c27","blockNumber":"0x114","transactionHash":"0x05378d01c90c20572b904bfe25239367cb4951e4b2e186f74e42c376b6baa7a5","transactionIndex":"0x0","logIndex":"0x3","removed":false},{"address":"0x93354845030274cd4bf1686abd60ab28ec52e1a7","topics":["0xaa1377f7ec93c239e959efa811f7b8554c036fd7a706c23e58024626a8f3db96","0x000000000000000000000000cb6600d6ccdd50474926a955b920e91ec9eb4db1"],"data":"0x0000000000000000000000000000000000000000000000000000000000000013","blockHash":"0xd775bdceed6afbcfee31a5718c41ff4369fc66ba2a7d32e31af69555d8c92c27","blockNumber":"0x114","transactionHash":"0x05378d01c90c20572b904bfe25239367cb4951e4b2e186f74e42c376b6baa7a5","transactionIndex":"0x0","logIndex":"0x4","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0xcd91156b4607a66e03194df5423537108085ebd28cca92794de7e9c53bd4c1c7","0x00000000000000000000000020f33ce90a13a4b5e7697e3544c3083b8f8a51d4"],"data":"0x000000000000000000000000000000000000000000000000000000000000007b","blockHash":"0xd775bdceed6afbcfee31a5718c41ff4369fc66ba2a7d32e31af69555d8c92c27","blockNumber":"0x114","transactionHash":"0x05378d01c90c20572b904bfe25239367cb4951e4b2e186f74e42c376b6baa7a5","transactionIndex":"0x0","logIndex":"0x5","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0xb2217585c246e507e3fcadd4d32d0177479d19c83452fabed3d7650cac3b0420","0x0000000000000000000000004fea76427b8345861e80a3540a8a9d936fd39391"],"data":"0x000000000000000000000000000000000000000000000000000000000000007b","blockHash":"0xd775bdceed6afbcfee31a5718c41ff4369fc66ba2a7d32e31af69555d8c92c27","blockNumber":"0x114","transactionHash":"0x05378d01c90c20572b904bfe25239367cb4951e4b2e186f74e42c376b6baa7a5","transactionIndex":"0x0","logIndex":"0x6","removed":false},{"address":"0xd9a998cac66092748ffec7cfbd155aae1737c2ff","topics":["0xb0d234274aef7a61aa5a2eb44c23881ebf46a068cccbd413c978bcbd555fe17f","0x000000000000000000000000cb6600d6ccdd50474926a955b920e91ec9eb4db1"],"data":"0x000000000000000000000000000000000000000000000000000000000000007b","blockHash":"0xd775bdceed6afbcfee31a5718c41ff4369fc66ba2a7d32e31af69555d8c92c27","blockNumber":"0x114","transactionHash":"0x05378d01c90c20572b904bfe25239367cb4951e4b2e186f74e42c376b6baa7a5","transactionIndex":"0x0","logIndex":"0x7","removed":false}]
logsBloom               0x00000000000020000000000000000300000002000000000000000002800000002000000000020000000000000000000000280600000200000000000000000000000000000008800000000000800000000000000000000000000000000000040502000000200000000000000000000000000000000000000000000000000008000000000040000010000000200000000000000000000000000000000000000000000010080000000000000008000000000000000082000000000000000000000020000000000000000000000000000000000400000000000001800000000000000000000000000000000000000000000000200008000008000020000000000020
root
status                  1
transactionHash         0x05378d01c90c20572b904bfe25239367cb4951e4b2e186f74e42c376b6baa7a5
transactionIndex        0
type                    2
cast send 0xd9A998CaC66092748FfEc7cFBD155Aae1737C2fF "delegate(address,uint256)" 0xcB6600d6cCdd50474926A955B920E91eC9Eb4Db1 123 --private-key 0xfffdbb37105441e14b0ee6330d855d8504ff39e705c3afa8f859ac9865f99306 --gas-limit 131760

blockHash               0x651138af5cd9147091001604286c174aa9c8180175101da6474aa5c35a202d37
blockNumber             279
contractAddress
cumulativeGasUsed       131757
effectiveGasPrice
gasUsed                 131757
logs                    [{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0xcd91156b4607a66e03194df5423537108085ebd28cca92794de7e9c53bd4c1c7","0x00000000000000000000000093354845030274cd4bf1686abd60ab28ec52e1a7"],"data":"0x000000000000000000000000000000000000000000000000000000000000000c","blockHash":"0x737215ecc3f8558cc9346c9f8833b050eccbe49c8401a1b17e61335d5a812194","blockNumber":"0x117","transactionHash":"0x4861d52e8dc47cdb92487fd8c4b20881d3a235c99cf00c3cd59e8c3cf4655fa9","transactionIndex":"0x0","logIndex":"0x0","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0xb2217585c246e507e3fcadd4d32d0177479d19c83452fabed3d7650cac3b0420","0x00000000000000000000000020f33ce90a13a4b5e7697e3544c3083b8f8a51d4"],"data":"0x000000000000000000000000000000000000000000000000000000000000000c","blockHash":"0x737215ecc3f8558cc9346c9f8833b050eccbe49c8401a1b17e61335d5a812194","blockNumber":"0x117","transactionHash":"0x4861d52e8dc47cdb92487fd8c4b20881d3a235c99cf00c3cd59e8c3cf4655fa9","transactionIndex":"0x0","logIndex":"0x1","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0x69ca02dd4edd7bf0a4abb9ed3b7af3f14778db5d61921c7dc7cd545266326de2","0x00000000000000000000000020f33ce90a13a4b5e7697e3544c3083b8f8a51d4"],"data":"0x000000000000000000000000000000000000000000000000000000000000000c","blockHash":"0x737215ecc3f8558cc9346c9f8833b050eccbe49c8401a1b17e61335d5a812194","blockNumber":"0x117","transactionHash":"0x4861d52e8dc47cdb92487fd8c4b20881d3a235c99cf00c3cd59e8c3cf4655fa9","transactionIndex":"0x0","logIndex":"0x2","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0x516772d06520d23d2705f0b46a1fa6deec0ae36a2c00db049bd5f4094a123b85","0x00000000000000000000000093354845030274cd4bf1686abd60ab28ec52e1a7"],"data":"0x","blockHash":"0x737215ecc3f8558cc9346c9f8833b050eccbe49c8401a1b17e61335d5a812194","blockNumber":"0x117","transactionHash":"0x4861d52e8dc47cdb92487fd8c4b20881d3a235c99cf00c3cd59e8c3cf4655fa9","transactionIndex":"0x0","logIndex":"0x3","removed":false},{"address":"0x93354845030274cd4bf1686abd60ab28ec52e1a7","topics":["0xaa1377f7ec93c239e959efa811f7b8554c036fd7a706c23e58024626a8f3db96","0x000000000000000000000000cb6600d6ccdd50474926a955b920e91ec9eb4db1"],"data":"0x000000000000000000000000000000000000000000000000000000000000000c","blockHash":"0x737215ecc3f8558cc9346c9f8833b050eccbe49c8401a1b17e61335d5a812194","blockNumber":"0x117","transactionHash":"0x4861d52e8dc47cdb92487fd8c4b20881d3a235c99cf00c3cd59e8c3cf4655fa9","transactionIndex":"0x0","logIndex":"0x4","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0xcd91156b4607a66e03194df5423537108085ebd28cca92794de7e9c53bd4c1c7","0x00000000000000000000000020f33ce90a13a4b5e7697e3544c3083b8f8a51d4"],"data":"0x000000000000000000000000000000000000000000000000000000000000007b","blockHash":"0x737215ecc3f8558cc9346c9f8833b050eccbe49c8401a1b17e61335d5a812194","blockNumber":"0x117","transactionHash":"0x4861d52e8dc47cdb92487fd8c4b20881d3a235c99cf00c3cd59e8c3cf4655fa9","transactionIndex":"0x0","logIndex":"0x5","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0xb2217585c246e507e3fcadd4d32d0177479d19c83452fabed3d7650cac3b0420","0x0000000000000000000000004fea76427b8345861e80a3540a8a9d936fd39391"],"data":"0x000000000000000000000000000000000000000000000000000000000000007b","blockHash":"0x737215ecc3f8558cc9346c9f8833b050eccbe49c8401a1b17e61335d5a812194","blockNumber":"0x117","transactionHash":"0x4861d52e8dc47cdb92487fd8c4b20881d3a235c99cf00c3cd59e8c3cf4655fa9","transactionIndex":"0x0","logIndex":"0x6","removed":false},{"address":"0xd9a998cac66092748ffec7cfbd155aae1737c2ff","topics":["0xb0d234274aef7a61aa5a2eb44c23881ebf46a068cccbd413c978bcbd555fe17f","0x000000000000000000000000cb6600d6ccdd50474926a955b920e91ec9eb4db1"],"data":"0x000000000000000000000000000000000000000000000000000000000000007b","blockHash":"0x737215ecc3f8558cc9346c9f8833b050eccbe49c8401a1b17e61335d5a812194","blockNumber":"0x117","transactionHash":"0x4861d52e8dc47cdb92487fd8c4b20881d3a235c99cf00c3cd59e8c3cf4655fa9","transactionIndex":"0x0","logIndex":"0x7","removed":false}]
logsBloom               0x00000000000020000000000000000300000002000000000000000002800000002000000000020000000000000000000000280600000200000000000000000000000000000008800000000000800000000000000000000000000000000000040502000000200000000000000000000000000000000000000000000000000008000000000040000010000000200000000000000000000000000000000000000000000010080000000000000008000000000000000082000000000000000000000020000000000000000000000000000000000400000000000001800000000000000000000000000000000000000000000000200008000008000020000000000020
root
status                  1
transactionHash         0x4861d52e8dc47cdb92487fd8c4b20881d3a235c99cf00c3cd59e8c3cf4655fa9
transactionIndex        0
type                    2
cast estimate 0xd9A998CaC66092748FfEc7cFBD155Aae1737C2fF "delegate(address,uint256)" 0xcB6600d6cCdd50474926A955B920E91eC9Eb4Db1 123 --from 0x20f33CE90A13a4b5E7697E3544c3083B8F8A51D4
114407
cast estimate 0xd9A998CaC66092748FfEc7cFBD155Aae1737C2fF "delegate(address,uint256)" 0xcB6600d6cCdd50474926A955B920E91eC9Eb4Db1 123 --from 0x20f33CE90A13a4b5E7697E3544c3083B8F8A51D4
114407
cast estimate 0xd9A998CaC66092748FfEc7cFBD155Aae1737C2fF "delegate(address,uint256)" 0xcB6600d6cCdd50474926A955B920E91eC9Eb4Db1 123 --from 0x20f33CE90A13a4b5E7697E3544c3083B8F8A51D4
114407
cast estimate 0xd9A998CaC66092748FfEc7cFBD155Aae1737C2fF "delegate(address,uint256)" 0xcB6600d6cCdd50474926A955B920E91eC9Eb4Db1 123 --from 0x20f33CE90A13a4b5E7697E3544c3083B8F8A51D4
114407
cast send 0xd9A998CaC66092748FfEc7cFBD155Aae1737C2fF "delegate(address,uint256)" 0xcB6600d6cCdd50474926A955B920E91eC9Eb4Db1 123 --private-key 0xfffdbb37105441e14b0ee6330d855d8504ff39e705c3afa8f859ac9865f99306 --gas-limit 131760

blockHash               0x76d9947e6ff06d8c6a46c29388cc248c15e1509aea811be2ef4c42bb1495db94
blockNumber             294
contractAddress
cumulativeGasUsed       131760
effectiveGasPrice
gasUsed                 131760
logs                    [{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0xcd91156b4607a66e03194df5423537108085ebd28cca92794de7e9c53bd4c1c7","0x00000000000000000000000093354845030274cd4bf1686abd60ab28ec52e1a7"],"data":"0x000000000000000000000000000000000000000000000000000000000000004a","blockHash":"0x99dbf1a3bb70bf4334dcaf241f9f72ea7107833053b931af7cfc6464776eeacf","blockNumber":"0x126","transactionHash":"0xf9d63374fd87cbe1c481230e7c1421e6a8d68201629bc932f47baef49072ea72","transactionIndex":"0x0","logIndex":"0x0","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0xb2217585c246e507e3fcadd4d32d0177479d19c83452fabed3d7650cac3b0420","0x00000000000000000000000020f33ce90a13a4b5e7697e3544c3083b8f8a51d4"],"data":"0x000000000000000000000000000000000000000000000000000000000000004a","blockHash":"0x99dbf1a3bb70bf4334dcaf241f9f72ea7107833053b931af7cfc6464776eeacf","blockNumber":"0x126","transactionHash":"0xf9d63374fd87cbe1c481230e7c1421e6a8d68201629bc932f47baef49072ea72","transactionIndex":"0x0","logIndex":"0x1","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0x69ca02dd4edd7bf0a4abb9ed3b7af3f14778db5d61921c7dc7cd545266326de2","0x00000000000000000000000020f33ce90a13a4b5e7697e3544c3083b8f8a51d4"],"data":"0x000000000000000000000000000000000000000000000000000000000000004a","blockHash":"0x99dbf1a3bb70bf4334dcaf241f9f72ea7107833053b931af7cfc6464776eeacf","blockNumber":"0x126","transactionHash":"0xf9d63374fd87cbe1c481230e7c1421e6a8d68201629bc932f47baef49072ea72","transactionIndex":"0x0","logIndex":"0x2","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0x516772d06520d23d2705f0b46a1fa6deec0ae36a2c00db049bd5f4094a123b85","0x00000000000000000000000093354845030274cd4bf1686abd60ab28ec52e1a7"],"data":"0x","blockHash":"0x99dbf1a3bb70bf4334dcaf241f9f72ea7107833053b931af7cfc6464776eeacf","blockNumber":"0x126","transactionHash":"0xf9d63374fd87cbe1c481230e7c1421e6a8d68201629bc932f47baef49072ea72","transactionIndex":"0x0","logIndex":"0x3","removed":false},{"address":"0x93354845030274cd4bf1686abd60ab28ec52e1a7","topics":["0xaa1377f7ec93c239e959efa811f7b8554c036fd7a706c23e58024626a8f3db96","0x000000000000000000000000cb6600d6ccdd50474926a955b920e91ec9eb4db1"],"data":"0x000000000000000000000000000000000000000000000000000000000000004a","blockHash":"0x99dbf1a3bb70bf4334dcaf241f9f72ea7107833053b931af7cfc6464776eeacf","blockNumber":"0x126","transactionHash":"0xf9d63374fd87cbe1c481230e7c1421e6a8d68201629bc932f47baef49072ea72","transactionIndex":"0x0","logIndex":"0x4","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0xcd91156b4607a66e03194df5423537108085ebd28cca92794de7e9c53bd4c1c7","0x00000000000000000000000020f33ce90a13a4b5e7697e3544c3083b8f8a51d4"],"data":"0x000000000000000000000000000000000000000000000000000000000000007b","blockHash":"0x99dbf1a3bb70bf4334dcaf241f9f72ea7107833053b931af7cfc6464776eeacf","blockNumber":"0x126","transactionHash":"0xf9d63374fd87cbe1c481230e7c1421e6a8d68201629bc932f47baef49072ea72","transactionIndex":"0x0","logIndex":"0x5","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0xb2217585c246e507e3fcadd4d32d0177479d19c83452fabed3d7650cac3b0420","0x0000000000000000000000004fea76427b8345861e80a3540a8a9d936fd39391"],"data":"0x000000000000000000000000000000000000000000000000000000000000007b","blockHash":"0x99dbf1a3bb70bf4334dcaf241f9f72ea7107833053b931af7cfc6464776eeacf","blockNumber":"0x126","transactionHash":"0xf9d63374fd87cbe1c481230e7c1421e6a8d68201629bc932f47baef49072ea72","transactionIndex":"0x0","logIndex":"0x6","removed":false},{"address":"0xd9a998cac66092748ffec7cfbd155aae1737c2ff","topics":["0xb0d234274aef7a61aa5a2eb44c23881ebf46a068cccbd413c978bcbd555fe17f","0x000000000000000000000000cb6600d6ccdd50474926a955b920e91ec9eb4db1"],"data":"0x000000000000000000000000000000000000000000000000000000000000007b","blockHash":"0x99dbf1a3bb70bf4334dcaf241f9f72ea7107833053b931af7cfc6464776eeacf","blockNumber":"0x126","transactionHash":"0xf9d63374fd87cbe1c481230e7c1421e6a8d68201629bc932f47baef49072ea72","transactionIndex":"0x0","logIndex":"0x7","removed":false}]
logsBloom               0x00000000000020000000000000000300000002000000000000000002800000002000000000020000000000000000000000280600000200000000000000000000000000000008800000000000800000000000000000000000000000000000040502000000200000000000000000000000000000000000000000000000000008000000000040000010000000200000000000000000000000000000000000000000000010080000000000000008000000000000000082000000000000000000000020000000000000000000000000000000000400000000000001800000000000000000000000000000000000000000000000200008000008000020000000000020
root
status                  1
transactionHash         0xf9d63374fd87cbe1c481230e7c1421e6a8d68201629bc932f47baef49072ea72
transactionIndex        0
type                    2
cast estimate 0xd9A998CaC66092748FfEc7cFBD155Aae1737C2fF "delegate(address,uint256)" 0xcB6600d6cCdd50474926A955B920E91eC9Eb4Db1 123 --from 0x20f33CE90A13a4b5E7697E3544c3083B8F8A51D4
114407
cast send 0xd9A998CaC66092748FfEc7cFBD155Aae1737C2fF "delegate(address,uint256)" 0xcB6600d6cCdd50474926A955B920E91eC9Eb4Db1 123 --private-key 0xfffdbb37105441e14b0ee6330d855d8504ff39e705c3afa8f859ac9865f99306 --gas-limit 115000

blockHash               0x49d42df0de59c719f9cc39eb4947d7b9877427e3dd49994b6edce17a77199c2d
blockNumber             305
contractAddress
cumulativeGasUsed       115000
effectiveGasPrice
gasUsed                 115000
logs                    []
logsBloom               0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
root
status                  0
transactionHash         0x31f7e064f42c7cd1ba47e7ba754ef1a36bca817f19262caac5584d69165f67bb
transactionIndex        0
type                    2
cast estimate 0xd9A998CaC66092748FfEc7cFBD155Aae1737C2fF "delegate(address,uint256)" 0xcB6600d6cCdd50474926A955B920E91eC9Eb4Db1 123 --from 0x20f33CE90A13a4b5E7697E3544c3083B8F8A51D4
131757
cast estimate 0xd9A998CaC66092748FfEc7cFBD155Aae1737C2fF "delegate(address,uint256)" 0xcB6600d6cCdd50474926A955B920E91eC9Eb4Db1 123 --from 0x20f33CE90A13a4b5E7697E3544c3083B8F8A51D4
131757
cast send 0xd9A998CaC66092748FfEc7cFBD155Aae1737C2fF "delegate(address,uint256)" 0xcB6600d6cCdd50474926A955B920E91eC9Eb4Db1 123 --private-key 0xfffdbb37105441e14b0ee6330d855d8504ff39e705c3afa8f859ac9865f99306 --gas-limit 115000

blockHash               0xc2532c010b6dc54b334a61d94decaa96d588e5e1947059e36dfda73c46e07b5b
blockNumber             434
contractAddress
cumulativeGasUsed       115000
effectiveGasPrice
gasUsed                 115000
logs                    []
logsBloom               0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
root
status                  0
transactionHash         0x6bf0714bdb921932580424a4cc97dfc3950be83071483c3ea27d93bca615b7a5
transactionIndex        0
type                    2
cast estimate 0xd9A998CaC66092748FfEc7cFBD155Aae1737C2fF "delegate(address,uint256)" 0xcB6600d6cCdd50474926A955B920E91eC9Eb4Db1 123 --from 0x20f33CE90A13a4b5E7697E3544c3083B8F8A51D4
131760
cast send 0xd9A998CaC66092748FfEc7cFBD155Aae1737C2fF "delegate(address,uint256)" 0xcB6600d6cCdd50474926A955B920E91eC9Eb4Db1 123 --private-key 0xfffdbb37105441e14b0ee6330d855d8504ff39e705c3afa8f859ac9865f99306 --gas-limit 155000

blockHash               0xd8298fb5ddf32975108b4daffb2c3150f55094eaa0aa3fee133cfd52d30e765f
blockNumber             442
contractAddress
cumulativeGasUsed       131760
effectiveGasPrice
gasUsed                 131760
logs                    [{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0xcd91156b4607a66e03194df5423537108085ebd28cca92794de7e9c53bd4c1c7","0x00000000000000000000000093354845030274cd4bf1686abd60ab28ec52e1a7"],"data":"0x0000000000000000000000000000000000000000000000000000000000000356","blockHash":"0xa09d33b39f315fa706861d78d74aab8552b3e9062a5c1bb3f285fcd9484c30e7","blockNumber":"0x1ba","transactionHash":"0x024e97524e1c6e907ebb2812a6d8e5db9073c57d1b8251bb67bb8170dc817890","transactionIndex":"0x0","logIndex":"0x0","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0xb2217585c246e507e3fcadd4d32d0177479d19c83452fabed3d7650cac3b0420","0x00000000000000000000000020f33ce90a13a4b5e7697e3544c3083b8f8a51d4"],"data":"0x0000000000000000000000000000000000000000000000000000000000000356","blockHash":"0xa09d33b39f315fa706861d78d74aab8552b3e9062a5c1bb3f285fcd9484c30e7","blockNumber":"0x1ba","transactionHash":"0x024e97524e1c6e907ebb2812a6d8e5db9073c57d1b8251bb67bb8170dc817890","transactionIndex":"0x0","logIndex":"0x1","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0x69ca02dd4edd7bf0a4abb9ed3b7af3f14778db5d61921c7dc7cd545266326de2","0x00000000000000000000000020f33ce90a13a4b5e7697e3544c3083b8f8a51d4"],"data":"0x0000000000000000000000000000000000000000000000000000000000000356","blockHash":"0xa09d33b39f315fa706861d78d74aab8552b3e9062a5c1bb3f285fcd9484c30e7","blockNumber":"0x1ba","transactionHash":"0x024e97524e1c6e907ebb2812a6d8e5db9073c57d1b8251bb67bb8170dc817890","transactionIndex":"0x0","logIndex":"0x2","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0x516772d06520d23d2705f0b46a1fa6deec0ae36a2c00db049bd5f4094a123b85","0x00000000000000000000000093354845030274cd4bf1686abd60ab28ec52e1a7"],"data":"0x","blockHash":"0xa09d33b39f315fa706861d78d74aab8552b3e9062a5c1bb3f285fcd9484c30e7","blockNumber":"0x1ba","transactionHash":"0x024e97524e1c6e907ebb2812a6d8e5db9073c57d1b8251bb67bb8170dc817890","transactionIndex":"0x0","logIndex":"0x3","removed":false},{"address":"0x93354845030274cd4bf1686abd60ab28ec52e1a7","topics":["0xaa1377f7ec93c239e959efa811f7b8554c036fd7a706c23e58024626a8f3db96","0x000000000000000000000000cb6600d6ccdd50474926a955b920e91ec9eb4db1"],"data":"0x0000000000000000000000000000000000000000000000000000000000000356","blockHash":"0xa09d33b39f315fa706861d78d74aab8552b3e9062a5c1bb3f285fcd9484c30e7","blockNumber":"0x1ba","transactionHash":"0x024e97524e1c6e907ebb2812a6d8e5db9073c57d1b8251bb67bb8170dc817890","transactionIndex":"0x0","logIndex":"0x4","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0xcd91156b4607a66e03194df5423537108085ebd28cca92794de7e9c53bd4c1c7","0x00000000000000000000000020f33ce90a13a4b5e7697e3544c3083b8f8a51d4"],"data":"0x000000000000000000000000000000000000000000000000000000000000007b","blockHash":"0xa09d33b39f315fa706861d78d74aab8552b3e9062a5c1bb3f285fcd9484c30e7","blockNumber":"0x1ba","transactionHash":"0x024e97524e1c6e907ebb2812a6d8e5db9073c57d1b8251bb67bb8170dc817890","transactionIndex":"0x0","logIndex":"0x5","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0xb2217585c246e507e3fcadd4d32d0177479d19c83452fabed3d7650cac3b0420","0x0000000000000000000000004fea76427b8345861e80a3540a8a9d936fd39391"],"data":"0x000000000000000000000000000000000000000000000000000000000000007b","blockHash":"0xa09d33b39f315fa706861d78d74aab8552b3e9062a5c1bb3f285fcd9484c30e7","blockNumber":"0x1ba","transactionHash":"0x024e97524e1c6e907ebb2812a6d8e5db9073c57d1b8251bb67bb8170dc817890","transactionIndex":"0x0","logIndex":"0x6","removed":false},{"address":"0xd9a998cac66092748ffec7cfbd155aae1737c2ff","topics":["0xb0d234274aef7a61aa5a2eb44c23881ebf46a068cccbd413c978bcbd555fe17f","0x000000000000000000000000cb6600d6ccdd50474926a955b920e91ec9eb4db1"],"data":"0x000000000000000000000000000000000000000000000000000000000000007b","blockHash":"0xa09d33b39f315fa706861d78d74aab8552b3e9062a5c1bb3f285fcd9484c30e7","blockNumber":"0x1ba","transactionHash":"0x024e97524e1c6e907ebb2812a6d8e5db9073c57d1b8251bb67bb8170dc817890","transactionIndex":"0x0","logIndex":"0x7","removed":false}]
logsBloom               0x00000000000020000000000000000300000002000000000000000002800000002000000000020000000000000000000000280600000200000000000000000000000000000008800000000000800000000000000000000000000000000000040502000000200000000000000000000000000000000000000000000000000008000000000040000010000000200000000000000000000000000000000000000000000010080000000000000008000000000000000082000000000000000000000020000000000000000000000000000000000400000000000001800000000000000000000000000000000000000000000000200008000008000020000000000020
root
status                  1
transactionHash         0x024e97524e1c6e907ebb2812a6d8e5db9073c57d1b8251bb67bb8170dc817890
transactionIndex        0
type                    2
cast estimate 0xd9A998CaC66092748FfEc7cFBD155Aae1737C2fF "delegate(address,uint256)" 0xcB6600d6cCdd50474926A955B920E91eC9Eb4Db1 123 --from 0x20f33CE90A13a4b5E7697E3544c3083B8F8A51D4
114470
cast send 0xd9A998CaC66092748FfEc7cFBD155Aae1737C2fF "delegate(address,uint256)" 0xcB6600d6cCdd50474926A955B920E91eC9Eb4Db1 123 --private-key 0xfffdbb37105441e14b0ee6330d855d8504ff39e705c3afa8f859ac9865f99306 --gas-limit 117000

blockHash               0x7615b6ca3cee0d7f9f81d2c6589e7fbb3baf49a43cea2ad0a85e4b3abd890d6d
blockNumber             454
contractAddress
cumulativeGasUsed       117000
effectiveGasPrice
gasUsed                 117000
logs                    []
logsBloom               0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
root
status                  0
transactionHash         0x1aeba2283d9112a77ebb520cceb0afcf201a8ade951e5cbeb093bc697932bb9c
transactionIndex        0
type                    2
cast estimate 0xd9A998CaC66092748FfEc7cFBD155Aae1737C2fF "delegate(address,uint256)" 0xcB6600d6cCdd50474926A955B920E91eC9Eb4Db1 123 --from 0x20f33CE90A13a4b5E7697E3544c3083B8F8A51D4
131820
cast send 0xd9A998CaC66092748FfEc7cFBD155Aae1737C2fF "delegate(address,uint256)" 0xcB6600d6cCdd50474926A955B920E91eC9Eb4Db1 123 --private-key 0xfffdbb37105441e14b0ee6330d855d8504ff39e705c3afa8f859ac9865f99306 --gas-limit 155000

blockHash               0xfe1c37d2f847f7fe0c9655b629b2dcc2f926b1cf6430d503296d4839fcd61850
blockNumber             469
contractAddress
cumulativeGasUsed       131823
effectiveGasPrice
gasUsed                 131823
logs                    [{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0xcd91156b4607a66e03194df5423537108085ebd28cca92794de7e9c53bd4c1c7","0x00000000000000000000000093354845030274cd4bf1686abd60ab28ec52e1a7"],"data":"0x00000000000000000000000000000000000000000000000000000000000000b2","blockHash":"0xcb8d806c83df955e234f14addb0e66935ab11bff3bfb0de7140673574d69d007","blockNumber":"0x1d5","transactionHash":"0xeca5504a756b696011f4203e067307e8f43475eb09fbe066462502f9dff40aa6","transactionIndex":"0x0","logIndex":"0x0","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0xb2217585c246e507e3fcadd4d32d0177479d19c83452fabed3d7650cac3b0420","0x00000000000000000000000020f33ce90a13a4b5e7697e3544c3083b8f8a51d4"],"data":"0x00000000000000000000000000000000000000000000000000000000000000b2","blockHash":"0xcb8d806c83df955e234f14addb0e66935ab11bff3bfb0de7140673574d69d007","blockNumber":"0x1d5","transactionHash":"0xeca5504a756b696011f4203e067307e8f43475eb09fbe066462502f9dff40aa6","transactionIndex":"0x0","logIndex":"0x1","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0x69ca02dd4edd7bf0a4abb9ed3b7af3f14778db5d61921c7dc7cd545266326de2","0x00000000000000000000000020f33ce90a13a4b5e7697e3544c3083b8f8a51d4"],"data":"0x00000000000000000000000000000000000000000000000000000000000000b2","blockHash":"0xcb8d806c83df955e234f14addb0e66935ab11bff3bfb0de7140673574d69d007","blockNumber":"0x1d5","transactionHash":"0xeca5504a756b696011f4203e067307e8f43475eb09fbe066462502f9dff40aa6","transactionIndex":"0x0","logIndex":"0x2","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0x516772d06520d23d2705f0b46a1fa6deec0ae36a2c00db049bd5f4094a123b85","0x00000000000000000000000093354845030274cd4bf1686abd60ab28ec52e1a7"],"data":"0x","blockHash":"0xcb8d806c83df955e234f14addb0e66935ab11bff3bfb0de7140673574d69d007","blockNumber":"0x1d5","transactionHash":"0xeca5504a756b696011f4203e067307e8f43475eb09fbe066462502f9dff40aa6","transactionIndex":"0x0","logIndex":"0x3","removed":false},{"address":"0x93354845030274cd4bf1686abd60ab28ec52e1a7","topics":["0xaa1377f7ec93c239e959efa811f7b8554c036fd7a706c23e58024626a8f3db96","0x000000000000000000000000cb6600d6ccdd50474926a955b920e91ec9eb4db1"],"data":"0x00000000000000000000000000000000000000000000000000000000000000b2","blockHash":"0xcb8d806c83df955e234f14addb0e66935ab11bff3bfb0de7140673574d69d007","blockNumber":"0x1d5","transactionHash":"0xeca5504a756b696011f4203e067307e8f43475eb09fbe066462502f9dff40aa6","transactionIndex":"0x0","logIndex":"0x4","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0xcd91156b4607a66e03194df5423537108085ebd28cca92794de7e9c53bd4c1c7","0x00000000000000000000000020f33ce90a13a4b5e7697e3544c3083b8f8a51d4"],"data":"0x000000000000000000000000000000000000000000000000000000000000007b","blockHash":"0xcb8d806c83df955e234f14addb0e66935ab11bff3bfb0de7140673574d69d007","blockNumber":"0x1d5","transactionHash":"0xeca5504a756b696011f4203e067307e8f43475eb09fbe066462502f9dff40aa6","transactionIndex":"0x0","logIndex":"0x5","removed":false},{"address":"0x4381dc2ab14285160c808659aee005d51255add7","topics":["0xb2217585c246e507e3fcadd4d32d0177479d19c83452fabed3d7650cac3b0420","0x0000000000000000000000004fea76427b8345861e80a3540a8a9d936fd39391"],"data":"0x000000000000000000000000000000000000000000000000000000000000007b","blockHash":"0xcb8d806c83df955e234f14addb0e66935ab11bff3bfb0de7140673574d69d007","blockNumber":"0x1d5","transactionHash":"0xeca5504a756b696011f4203e067307e8f43475eb09fbe066462502f9dff40aa6","transactionIndex":"0x0","logIndex":"0x6","removed":false},{"address":"0xd9a998cac66092748ffec7cfbd155aae1737c2ff","topics":["0xb0d234274aef7a61aa5a2eb44c23881ebf46a068cccbd413c978bcbd555fe17f","0x000000000000000000000000cb6600d6ccdd50474926a955b920e91ec9eb4db1"],"data":"0x000000000000000000000000000000000000000000000000000000000000007b","blockHash":"0xcb8d806c83df955e234f14addb0e66935ab11bff3bfb0de7140673574d69d007","blockNumber":"0x1d5","transactionHash":"0xeca5504a756b696011f4203e067307e8f43475eb09fbe066462502f9dff40aa6","transactionIndex":"0x0","logIndex":"0x7","removed":false}]
logsBloom               0x00000000000020000000000000000300000002000000000000000002800000002000000000020000000000000000000000280600000200000000000000000000000000000008800000000000800000000000000000000000000000000000040502000000200000000000000000000000000000000000000000000000000008000000000040000010000000200000000000000000000000000000000000000000000010080000000000000008000000000000000082000000000000000000000020000000000000000000000000000000000400000000000001800000000000000000000000000000000000000000000000200008000008000020000000000020
root
status                  1
transactionHash         0xeca5504a756b696011f4203e067307e8f43475eb09fbe066462502f9dff40aa6
transactionIndex        0
type                    2
cast estimate 0xd9A998CaC66092748FfEc7cFBD155Aae1737C2fF "delegate(address,uint256)" 0xcB6600d6cCdd50474926A955B920E91eC9Eb4Db1 123 --from 0x20f33CE90A13a4b5E7697E3544c3083B8F8A51D4
114482
cast send 0xd9A998CaC66092748FfEc7cFBD155Aae1737C2fF "delegate(address,uint256)" 0xcB6600d6cCdd50474926A955B920E91eC9Eb4Db1 123 --private-key 0xfffdbb37105441e14b0ee6330d855d8504ff39e705c3afa8f859ac9865f99306 --gas-limit 129000

blockHash               0x6eca5d7601ee7993a47a8fdfe37ef3af818b8638b185728ff814b86350f121af
blockNumber             477
contractAddress
cumulativeGasUsed       129000
effectiveGasPrice
gasUsed                 129000
logs                    []
logsBloom               0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
root
status                  0
transactionHash         0x4dd8c0e3fc4539c3b487dac0c8a0ee926c29fa7b9d5bfb9ce54c09fe6ac52bed
transactionIndex        0
type                    2
cast estimate 0xd9A998CaC66092748FfEc7cFBD155Aae1737C2fF "delegate(address,uint256)" 0xcB6600d6cCdd50474926A955B920E91eC9Eb4Db1 123 --from 0x20f33CE90A13a4b5E7697E3544c3083B8F8A51D4
131832
alexanderbez commented 1 year ago

Mhhh I don't think this has anything to do with caching TBH. Reward calculation relies heavily on the current block height, i.e. ctx.BlockHeight(). Are the heights between the two query paths the same? I presume you're using the latest height?

itsdevbear commented 1 year ago

Yeah @alexanderbez we are using the latest height as confirmed with some printf's, here is the codepath for creating the querycontext for use in the estimate gas rpc routine.

https://github.com/berachain/polaris/blob/074b083046cf6709fcc06a3d2255dd31b6fe344c/cosmos/x/evm/plugins/state/plugin.go#L502

itsdevbear commented 1 year ago

Notably if requested height == ctx.BlockHeight() we just return a cache context.

alexanderbez commented 1 year ago

I see. Maybe caching does have something to do with it. Recall that reward actually does some state modifications via IncrementValidatorPeriod. I wonder if that has something to do with it.

This might be one of those situations where we might need to whip out the good ole fmt.Println debugging in the withdrawDelegationRewards function. I'm curious what endingPeriod is between the two query paths?