Skip to content

Re-read required message length when the length check failed  #74

Open

Description

@akolotov

As per changes delivered under #67 it was introduced that the bridge contracts data are used to get required length of the message. The implemented logic assumes that the length is accessed only once when the bridge is being run. And for the case when the bridge contracts are upgraded as so the required length of the message is being changed, all bridge instances needs to be re-run.

Sometimes it is hard to manage restart of several independent application instances, so it will be useful to have an ability to re-read the length without the bridge re-initialization.

One of possible approach is to re-read the length every time when new message is being prepared. But it will introduce huge amount of similar RPC calls and huge amount of the same responses. It could impact the bridge instance performance.

Another approach was described here #67 (comment) and it was agreed that it could be implemented as soon as the work for #24 is finished.

Activity

  1. self-assigned this
    on Oct 17, 2018
  2. fvictorio commented on Oct 17, 2018

    @fvictorio

    The problem with the second approach is that the assert will continue to pass: the contract may have changed the required length, but the code is the same. If the code was modified, then the bridge had to be restarted, and re-reading the variable is not necessary.

    An alternative approach is this: in the estimateGas function, after all the checks we already have, we add one more checking if the required message length in the contract is different than the one we have. If it is, we throw an error indicating that, and use it to update the variable.

    What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions