-
Notifications
You must be signed in to change notification settings - Fork 152
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
Impl EthGetTransactionByHashLimited #4774
base: main
Are you sure you want to change the base?
Conversation
if let Ok(eth_tx) = EthTx::from_signed_message(ctx.chain_config().eth_chain_id, smsg) { | ||
return Ok(Some(eth_tx.into())); | ||
} | ||
type Params = (EthHash, Option<ChainEpoch>); |
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.
Why did you choose an Option<ChainEpoch>
and not just a ChainEpoch
?
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.
because look_back_limit
is of type Option<i64>
in search_for_message
forest_filecoin::state_manager::StateManager
impl<DB> StateManager<DB>
pub async fn search_for_message(self: &Arc<Self>, from: Option<Arc<Tipset>>, msg_cid: Cid, look_back_limit: Option<i64>, allow_replaced: Option<bool>) -> Result<Option<(Arc<Tipset>, Receipt)>, Error>
where
// Bounds from impl:
DB: Blockstore + Send + Sync + 'static,
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.
Then let's add another test that checks the case where chain epoch is None
.
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.
None
is tested by EthGetTransactionByHash
https://github.com/ChainSafe/forest/pull/4774/files#r1766769807
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.
You're speaking of testing get_eth_transaction_by_hash
function which I think is not the same.
Adding the test:
tests.push(RpcTest::identity(EthGetTransactionByHashLimited::request(
(tx.hash.clone(), None),
)?));
results in:
./forest-tool api compare --lotus /ip4/127.0.0.1/tcp/1234/http --forest /ip4/127.0.0.1/tcp/2345/http forest_snapshot_calibnet_2024-09-10_height_1954295.forest.car.zst --filter EthGetTransactionByHashLimited
| RPC Method | Forest | Lotus |
|---------------------------------------------|-------------------|-------|
| Filecoin.EthGetTransactionByHashLimited (4) | CustomCheckFailed | Valid |
| Filecoin.EthGetTransactionByHashLimited (8) | Valid | Valid |
Error: Some tests failed
@@ -1557,7 +1557,9 @@ fn eth_state_tests_with_tipset<DB: Blockstore>( | |||
tests.push(RpcTest::identity(EthGetTransactionByHash::request((tx | |||
.hash | |||
.clone(),))?)); | |||
|
|||
tests.push(RpcTest::identity(EthGetTransactionByHashLimited::request( |
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 guess we need a test that has None
epoch passed, as previously mentioned by @elmattic.
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.
for EthGetTransactionByHash
we use None
get_eth_transaction_by_hash(ctx, tx_hash, None).await
and for EthGetTransactionByHashLimited
we use
get_eth_transaction_by_hash(ctx, tx_hash, limit).await
The CI needs to be green, then we're ready to rumble. |
Summary of changes
Changes introduced in this pull request:
Filecoin.EthGetTransactionByHashLimited
and add testReference issue to close (if applicable)
Closes #4703
Other information and links
Change checklist