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

Comparison and Testing of Artela-Rollkit and Artela Features #9

Open
LukeNinjaX opened this issue Nov 25, 2024 · 3 comments
Open

Comparison and Testing of Artela-Rollkit and Artela Features #9

LukeNinjaX opened this issue Nov 25, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@LukeNinjaX
Copy link
Contributor

LukeNinjaX commented Nov 25, 2024

  1. Feature Tests in https://github.com/artela-network/aspect-tooling/tree/main/packages/testcases/tests/testcases;
  2. Stability and Performance Testing;
  3. Data Validation and Verification for Submission to the DA Layer.
@LukeNinjaX LukeNinjaX added the enhancement New feature or request label Nov 25, 2024
@LukeNinjaX LukeNinjaX added this to the v0.4.9 milestone Nov 25, 2024
@LukeNinjaX LukeNinjaX moved this to Ready in Artela Nov 25, 2024
@LukeNinjaX LukeNinjaX self-assigned this Nov 27, 2024
@LukeNinjaX
Copy link
Contributor Author

LukeNinjaX commented Dec 2, 2024

Issue 1

Description: Pub/Sub is not functioning as expected.

Reason:
The original subscription method involves sending requests to the CometBFT WebSocket RPC service. This service is only started when the CometBFT node is launched within the Cosmos SDK. However, in Rollkit, this service is not initialized. Consequently, the original Artela subscription mechanism, which depends on the Cosmos SDK, is incompatible with Artela-Rollkit.

In Rollkit's Subscribe method(func (s *service) Subscribe), the request for the RPC Subscribe is made, and the content is returned to the WebSocket client through the wsHandler(w http.ResponseWriter, r *http.Request). In this message forwarding process, query information, such as tm.event = 'NewBlockHeader', is not passed back.

Due to changes in the subscription response structure, certain modules of the Ethereum-compatible subscription functionality need to be partially refactored.

Created an enhancement request for Rollkit: rollkit/rollkit#1936
Fixed: TBD

LukeNinjaX added a commit that referenced this issue Dec 3, 2024
@LukeNinjaX LukeNinjaX moved this from Ready to In progress in Artela Dec 3, 2024
@LukeNinjaX
Copy link
Contributor Author

LukeNinjaX commented Dec 3, 2024

Issue 2

Describtion:
Send Transaction Failed(failed on getting gas price, fee, etc.): block result not found for height xxx
Created an bug report for Rollkit: rollkit/rollkit#1935

Reason:
Due to the design of Rollkit block data writing, some of the most recently written blocks are incomplete(in the code below, the Commit block and the response are written separately), which can result in a situation where the block header exists but the block body does not. In certain cases, this may cause the import and sending of transactions to fail.

func (m *Manager) publishBlock(ctx context.Context) error {
    ...
    // Commit the new state and block which writes to disk on the proxy app
    appHash, _, err := m.executor.Commit(ctx, newState, block, responses)
    if err != nil {
	    return err
    }
    // Update app hash in state
    newState.AppHash = appHash
    
    // SaveBlockResponses commits the DB tx
    err = m.store.SaveBlockResponses(ctx, blockHeight, responses)
    if err != nil {
	    return err
    }
    ...
}

In the query for BlockResults(code below), both blockData and blockResponses are queried separately. If it happens that the blockData has already been committed but the blockResponses have not yet been committed, the query will fail.

func (c *FullClient) BlockResults(ctx context.Context, height *int64) (*ctypes.ResultBlockResults, error) {
    ...
    header, _, err := c.node.Store.GetBlockData(ctx, h)
    if err != nil {
	    return nil, err
    }
    resp, err := c.node.Store.GetBlockResponses(ctx, h)
    if err != nil {
	    return nil, err
    }
    ...
}

@LukeNinjaX
Copy link
Contributor Author

Workaround for Issue 2: when querying the latest block, if the block is not ready yet, use the previous block.

@LukeNinjaX LukeNinjaX moved this from In progress to In review in Artela Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In review
Development

No branches or pull requests

1 participant