Closed peterbroadhurst closed 3 years ago
Here is a failure where the logs have been captured as an artifact: https://github.com/hyperledger/firefly/pull/234/checks?check_run_id=3838443338
~Am wondering if https://github.com/hyperledger/firefly/pull/208 being merged is related to this~
See below
Key lines in the log look like:
[32methconnect_0_1 |[0m [2021-10-08T12:32:32.025Z] INFO firefly -> 0x58890cc4cf8a3c1bf90bd11beeccc1b4c76cfed4
[32methconnect_0_1 |[0m [2021-10-08T12:32:32.025Z] INFO ABI with ID not found locally
[32methconnect_0_1 |[0m [2021-10-08T12:32:32.026Z] ERROR <-- POST /contracts/firefly/BatchPin [500]: No ABI found with ID
Moving this one over to Ethconnect from the CLI
Ok - tracked this down to the point that I believe the ID in this line, must have been empty at the point we did the register into the contract registry: https://github.com/hyperledger/firefly-ethconnect/blob/8545f1c09d5fc9829508dac9a08d8c57210079eb/internal/contractgateway/smartcontractgw.go#L189
Looks like the code that ensures an ID is set on the header, might only exist in the Kafka codepath: https://github.com/hyperledger/firefly-ethconnect/blob/8545f1c09d5fc9829508dac9a08d8c57210079eb/internal/kafka/kafkabridge.go#L172-L174
But this seems very odd, as that's in the code that receives the message from the queue, not the REST API code that adds it.
Looking back at the code all the way before https://github.com/hyperledger/firefly-ethconnect/pull/139 to work out how the ID was assigned when it was always assigned.
Hmmn, looks like back then it was still only set on the webhooks
path, not the resttoeth
path.
So the problem might always have been there for this path, but masked by the bug just fixed in https://github.com/hyperledger/firefly-ethconnect/pull/158
The code change made in #160 had the intended effect.
However, it means that when you get through to this line of code, the id
is (as you would expect) a genuinely unique message ID - as it needs to be.
However, that code is passing requestID
as the abiID
into AddContract
.
That seems completely wrong. The ABI ID was unrelated to the unique request that was issued against the ABI.
So I think this code (which was a very edge case invocation in prior uses of ethconnect before FireFly) has always depended on the behavior that was just fixed in #158, where the requestID happened to be propagated through to the ABI ID.
So I need to instead pass the ABI ID explicitly, in the deploy message.
See additional detail on the fix here: https://github.com/hyperledger/firefly-ethconnect/pull/160#issuecomment-938735888